AWS:测试已部署的API

时间:2016-07-05 14:17:55

标签: api amazon-web-services

我们有一个API,我们想尝试与Amazon API Gateway连接。我一直在尝试一些非常基本的电话,但无济于事。例如,如果我们在使用Postman进行GET调用期间未在查询字符串中传递任何身份验证数据:

GET https://<host>/<resource>

然后我正确收到错误消息:

{
"error": "Invalid authentication key",
"errorcode": 0
} 

在网关中,我对该方法有以下设置:

  • Method Request

    • 无需授权,不需要API密钥
    • 某些查询字符串参数未在Postman或API网关调用中设置
    • 没有请求标题
    • 没有请求模型
  • Integration Request

    • HTTP代理集成类型,GET
    • 端点URl与我使用Postman上面调用的URL相同
    • 没有参数,标题或正文映射
  • Integration Response

    • 200 OK passthrough
  • Method response

    • 各种HTTP状态
    • 根据我们API的Swagger定义的响应模型

所有其他方法都有mock integration。通过Postman在我们的后端域调用该方法按预期工作(即给出上面的错误消息)。

调用已部署的API网关方法会导致:

  • "message": "Unknown endpoint error."如果使用API​​网关中的Method Test
  • 完成
  • "message": "Internal server error",如果从浏览器或邮递员处调用。

之前有没有人遇到过这个问题?

编辑:我刚注意到使用Postman或浏览器时设置的响应头之一是:

X-Cache: Error from cloudfront

文档说这个错误设置为if the origin server returns an expired certificate, an invalid certificate or a self-signed certificate, or if the origin server returns the certificate chain in the wrong order,但我们的证书是有效的,我无法注意到证书链的问题......

0 个答案:

没有答案
相关问题