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 Risposte
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
con risposta un anno fa
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
TECNICO DI SUPPORTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande