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回答
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
回答済み 1年前
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
サポートエンジニア
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ