0

When I published and API to AWS with Visual Studio I was getting a 403 error in the response when I called Get methods that contain a Body and according to the answer of @James Dean here: Are Get request with body allowed on AWS? 403 error from CloudFront the error is caused by cloudfront.

the error I received was the following:


<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)
Request ID:
</PRE>
        <ADDRESS></ADDRESS>
    </BODY>
</HTML>


so I researched 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.

  1. what would happen if I use regional API gateway without cloudfront?
  2. would that allow me to make get Request with body?
  3. is it possible to have API Gateway without cloudfront configured and what are the consequences of this?

Many Thanks

Enrique O. G.
  • 71
  • 1
  • 4
  • Regional API Gateway is API Gateway without the edge network optimizations provided by CloudFront. Try it and see what happens. I doubt very much it will work because a `GET` request -- by definition -- technically is allowed to contain a body but the body explicitly has no meaning -- everything there is to learn about a `GET` request is defined as existing in the URI and headers. Throwing an error is not incorrect behavior on the part of CloudFront, and I would expect an API Gateway regional endpoint to do the same, even with CloudFront out of the loop. Let us know what you find, testing. – Michael - sqlbot May 08 '19 at 01:18
  • Regional uses ALB/ELB so GET with body should be allowed, the problem is only with CloudFront and edge optimized uses CloudFront. – James Dean May 08 '19 at 11:36

0 Answers0