azureazure-appservicehttp-status-code-413

Azure App Service Returning 413 Payload Too Large on Long POST Request


Locally this works, but when hitting our Azure App Service API with a POST request which has a long (seemingly anything over somewhere around 100,000 characters) request body, we get a "413 Payload Too Large" response. This is a fairly long HTML string. It works fine with requests that are under somewhere around 100,000 characters, but not over around that.

This happens whether hitting the endpoint via from our app or using Postman, as shown in the attached image. So, it must be an Azure (which hosts the app that has the endpoint) limitation.

Is there a setting in Azure App Service that can be increased so that we don't get a "413"? Or how otherwise do we get around this problem?

Thank you413 Payload Too Large Error


Solution

  • @WaitingForGuacamole had the right solution above in the comments. Thank you!

    The default size is 100kb. I set it to much higher than that, and it works.

    app.use(bodyParser.json({limit:  '10mb'}));