Invoke API Error - AWS API Gateway

I am trying to create an API using the AWS API Gateway

  • First I created the resource as / sample
  • then created a get method
  • provided the final url and saved it.
  • In the Method Execution panel, select Method Request, add the headers of the HTTP headers as "Authorization", adding this to transfer the basic authentication data to the internal address, since the service is protected by basic authentication.
  • In the Method Execution panel, select Integration Request, mapped HTTP headers using method.request.path.Authorization
  • Select "Execution of the method", and in the field "Client" select "TEST", "Heading resolvability" - "Basic XXXXXX" After successfully completing the entire configuration, testing the API, receiving a "message": status code "Internal server error" -500

For your reference, my internal service runs on amazon-linux machine.

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

Could you tell me how to solve this problem?

+4
source share
3 answers

try method.request. heading . Login

+1
source

Varun is right, your display is incorrect.

"method.request. [source]. [name]", /querystring/header, name - , .

, , , .

+1

, API, :

  • AWS
  • "API-", (API), , (GET/POST/...)
  • " " 200, . " " "/json" "" .

enter image description here

  • You should also click on the “Integration Request Panel” and uncheck “Use integration with Lambda Proxy” [according to the attached image]

enter image description here

Last step

  • deploy the API in step (dev / test / prod)
0
source

Source: https://habr.com/ru/post/1606504/


All Articles