Can REST GET method in API Gateway support a request body? Does API Gateway drop the body?

0

I saw an earlier question but I have a specific question and some behavior from the server I can't find answers to.

Setup:

I have an API Gateway setup via VPC link. It has a GET method. It goes through a NLB and a ALB to a target EC2 hosting a SAP REST API. I see from the console and the REST spec that body requests for GET is not supported.

However, what will happen if someone sends a GET request WITH a body to the API gateway? Will API Gateway simply drop the body?

I presume the "best solution" here is to change it to a POST, if a request body is necessary?

2 Answers
0

I'm not 100% sure but I'd assume if you are using a Proxy request it would pass-through. But as a consumer, if you need a body, POST is the cleanest way and least confusing way for your consumers.

profile picture
bpyle
answered a year ago
0

For GET requests the body payload will be dropped and the backend will receive a blank payload. However, if you want the body to pass through you can change the Method in VPC Link integration Request to POST while keeping the resource method as GET.

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions