AWS API Gateway: Status Code 413, Request Entity too large

22,846

Solution 1

The 10MB payload limit applies to the message body. If you're running into limits on the header size, unfortunately these cannot be configured. They are stated on the CloudFront page: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html

In particular:

Custom headers: maximum length of a header name 256 characters

Custom headers: maximum length of a header value 2,048 characters

Custom headers: maximum length of all header values and names combined 10,240 characters

Solution 2

The limit for payload size currently cannot be changed. From https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html:

10MB payload size, which cannot be changed currently.

If you want more customization, you should run your API on an actual server (e.g. with Amazon EC2).

Share:
22,846

Related videos on Youtube

Mandeep Singh
Author by

Mandeep Singh

I am a full stack developer with a never ending desire to learn new things by building stuff. Over the last 10+ years of working as a software developer, I have developed expertise in Node, Express, Vue, Nuxt, React, Elasticsearch, Postgres, Docker and AWS technologies. I have worked on various products with small to medium sized teams and also as solo developer. I am passionate about my work and strive to build easy to scale and easy to maintain solutions, with a lot of emphasis on maintainability. I am quite efficient at rapid prototyping, building Minimum Viable Products (MVPs) quickly and then scaling them to full fledged production applications. Other than learning new things, I also enjoy sharing my learning with my peers and the developer community in general. This not only helps the people around me to grow together, but has also helped me in improving my own communication skills and become a better mentor and a better developer.

Updated on February 17, 2022

Comments

  • Mandeep Singh
    Mandeep Singh about 2 years

    I have a server less API with AWS API Gateway and Lambda function. I am using custom authorization function for authorization. The header is too large and due to which I am getting this error. Normally, for an nginx server, I would have changed the nging config and this would have been fixed. I don't know how to take care of this in AWS API Gateway.

Related