我正在尝试使用 AWS API 网关创建 API
- 首先我创建了一个资源作为 /sample
- 然后创建了一个方法 GET
- 提供 Endpoint-URL 并保存。
- 在 Method Execution 窗格中,选择 Method Request,将 HTTP Request Headers 添加为“Authorization”,添加此以将基本身份验证详细信息传递到后端 url,因为服务受到基本身份验证的保护,
- 在 Method Execution 窗格中,选择 Integration Request、mapped HTTP Headers、Mapped from as "method.request.path.Authorization"
- 选择 Method Execution,在 Client 框中选择 TEST,通过 Header Authorization - Basic XXXXXX 成功完成所有配置后,测试 API ,得到“message”:“Internal server error”状态码-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
你能告诉我如何解决这个问题吗?