0

For the microservice with basic CRUD operation and there is an interface to add resources in bulk(array of resources). Here we want to have a restriction of payload size to 1024KB(1MB). If the POST request payload size is >1MB then 400 bad request should be thrown else process the request.

By default the spring boot application marshal the json to Resource object.

Here I don't want to rely on content-length header and don't want to convert the object back to string to find the byte size.

Nagendran
  • 277
  • 2
  • 7

1 Answers1

0

As per this answer, you have to either configure your server or handle it in the code:

https://serverfault.com/questions/151090/is-there-a-maximum-size-for-content-of-an-http-post

For Tomcat:

Is there a max size for POST parameter content?

Where are you running your service?

Rahul
  • 637
  • 5
  • 16