aws-api-gateway – 调用API错误 – AWS API网关

我正在尝试使用AWS API网关创建API

>首先我创建了一个资源/ sample
>然后创建了一个方法GET
>提供了Endpoint-URL并保存了它.
>在“方法执行”窗格中,选择“方法请求”,将“HTTP请求标头”添加为“授权”,添加此项以将基本身份验证详细信息传递给后端URL,因为服务是通过基本身份验证保护的,
>在“方法执行”窗格中,选择“集成请求”,“映射的HTTP标头”,“映射为”method.request.path.Authorization“
>选择方法执行,在客户端框中,选择TEST,传递Header Authorization – Basic XXXXXX
成功完成所有配置后,测试API,获取“消息”:“内部服务器错误”状态代码-500

供您参考我的后端服务是在amazon-linux机器上运行的.

Checked logs:
   Execution log for request test-request
Tue Sep 08 16:43:54 UTC 2015 : Starting execution for request: test-invoke-request
Tue Sep 08 16:43:54 UTC 2015 : API Key: test-invoke-api-key
Tue Sep 08 16:43:54 UTC 2015 : Method request path: {}
Tue Sep 08 16:43:54 UTC 2015 : Method request query string: {}
Tue Sep 08 16:43:54 UTC 2015 : Method request headers: {Authorization=************p1c2Vy}
Tue Sep 08 16:43:54 UTC 2015 : Method request body before transformations: null
Tue Sep 08 16:43:54 UTC 2015 : Execution failed due to configuration error: Invalid endpoint address

你能告诉我如何解决这个问题吗?

最佳答案 尝试method.request.header.Authorization

点赞