Are get request with body allowed in AWS? 403 error

0

Hi,

I published an API to AWS with Visual Studio, for now I am testing the methods with postman, but all get methods that require a body are returning an error that mentions cloudfront in the response, I do not know if the issue is related to cloudfront or if is the AWS HTTP 1.1 specification implementation that does not allow get requests with body:

Note:Get request with body were a requirement from our client

this is the error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE>ERROR: The request could not be satisfied</TITLE> </HEAD> <BODY> <H1>403 ERROR</H1> <H2>The request could not be satisfied.</H2> <HR noshade size="1px"> Bad request.
    <BR clear="all">  
    <HR noshade size="1px">  
    <PRE>  

Generated by cloudfront (CloudFront)

</PRE> <ADDRESS></ADDRESS> </BODY> </HTML>

RFC 7231 HTTP/1.1 specification says the following:
A payload within a GET request message has no defined semantics;
sending a payload body on a GET request might cause some existing
implementations to reject the request.

so my questions are:

  1. are get request with body allowed in AWS?
  2. how AWS deals with get request with body?
  3. is there a way to use get methods with body on AWS?

Many Thanks

2개 답변
1

CloudFront rejects a get request with body.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestCustom-get-body

As noted in the RFC, this behavior might be different based on the implementations. With this reason, although RFC does not prohibit to use GET request with body, generally it is not encouraged to use it.

AWS
답변함 5년 전
0

Thanks for your answer @jwaataws, and I just have some doubts. I was researching that there are several types of API Gateway: Edge Optimized, Regional API Gateways and Private API Gateways. the regional API Gateway does not come with an implementation of cloudfront, so my questions are:

what would happen if I use regional API gateway without cloudfront?
would that allow me to make get Request with body?
or is it possible to have API Gateway without cloudfront configured and in that way allow get requests with body?

Many Thanks

Edited by: egzx73 on May 7, 2019 1:27 PM

답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠