0

I am using AWS API gateway and AWS lambda function.

When I invoke the API through the client like Postman and specify the HTTP operation, I get an error -

Response code: 401
Response:
{ "message": "Missing Authentication Token" }

Ideally I should receive an error - Response code 405 [Method not allowed]

Is there any way this can be configured?

1 Answer 1

1

Gateway Responses allow you to customize errors that are generated by API Gateway before the request reaches your backend. There is a MISSING_AUTHENTICATION_TOKEN response type which you can use for your use case.

https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.