部署 API 网关

huangapple go评论67阅读模式
英文:

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,请执行以下步骤:

  1. 从服务菜单中选择API Gateway。
  2. 从列表中选择您的API Gateway。
  3. 从页面左侧的菜单中选择Stages。
  4. 展开阶段以查看您的端点。
  5. 选择要获取URL的端点的HTTP方法(Post、Get等)。
  6. 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

To get the URL for an endpoint from the console, do this...

  1. Select API Gateway from the Services menu.
  2. Select your API Gateway from the list.
  3. Select Stages from the menu on the left hand side of the page.
  4. Expand the stage to see your endpoints
  5. Select the HTTP method (Post, Get, etc.) for the endpoint you want the URL for.
  6. 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.

huangapple
  • 本文由 发表于 2020年1月3日 21:40:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/59579612.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定