英文:
Deploy API gateway
问题
我按照这个指南的所有说明操作。
https://www.obytes.com/blog/image-resizing-on-the-fly-with-aws-lambda-api-gateway-and-s3-storage
在部署 API 网关后,我获得了以下 URL。
https://azqvbborn5.execute-api.us-east-1.amazonaws.com/dev
但当我访问上面提到的页面时出现以下错误。
{"message":"Missing Authentication Token"}
我如何测试 API 是否正常工作?
英文:
I followed all the instructions from this guide.
https://www.obytes.com/blog/image-resizing-on-the-fly-with-aws-lambda-api-gateway-and-s3-storage
I got the URL after deploying the api gateway.
https://azqvbborn5.execute-api.us-east-1.amazonaws.com/dev
But getting this error when I visit the page mentioned above.
{"message":"Missing Authentication Token"}
How do I test if the API is working correctly?
答案1
得分: 2
以下是翻译好的部分:
- 我的API主机名:https://idwe4id5y6.execute-api.us-west-2.amazonaws.com
- 带有阶段路径的我的API主机名:https://idwe4id5y6.execute-api.us-west-2.amazonaws.com/dev/
- 带有阶段和端点路径的我的API主机名:https://idwe4id5y6.execute-api.us-west-2.amazonaws.com/dev/stuff/things
要从控制台获取端点的URL,请执行以下步骤:
- 从服务菜单中选择API Gateway。
- 从列表中选择您的API Gateway。
- 从页面左侧的菜单中选择Stages。
- 展开阶段以查看您的端点。
- 选择要获取URL的端点的HTTP方法(Post、Get等)。
- URL将出现在页面右侧详细信息窗格的顶部。
希望这有所帮助!
英文:
A couple of things...
The URL you provided looks like the URL for an API Gateway and stage not API Gateway, stage, and endpoint, which is what you want. For example
- Hostname for my API: https://idwe4id5y6.execute-api.us-west-2.amazonaws.com
- Hostname for my API w/stage path: https://idwe4id5y6.execute-api.us-west-2.amazonaws.com/dev/
- Hostname for my API w/stage and endpoint path: https://idwe4id5y6.execute-api.us-west-2.amazonaws.com/dev/stuff/things
To get the URL for an endpoint from the console, do this...
- Select API Gateway from the Services menu.
- Select your API Gateway from the list.
- Select Stages from the menu on the left hand side of the page.
- Expand the stage to see your endpoints
- Select the HTTP method (Post, Get, etc.) for the endpoint you want the URL for.
- The URL will appear at the top of the detail pane on the right side of the page.
Hope this helps!
答案2
得分: 1
尝试访问 https://azqvbborn5.execute-api.us-east-1.amazonaws.com/dev/resize
当您未请求实际的 API Gateway 端点动词时,您将收到 {"message":"Missing Authentication Token"} 错误。
英文:
Try https://azqvbborn5.execute-api.us-east-1.amazonaws.com/dev/resize
You will get the {"message":"Missing Authentication Token"} error when you're not hitting an actual API Gateway endpoint verb.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论