Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a max size for POST parameter content?

I'm troubleshooting a Java app where XML is sent between two systems using HTTP POST and Servlet. I suspect that the problem is that the XML is growing way too big. Is it possible that this is the problem? Is there a limit?

When it doesn't work, the request.getParameter("message") on the consumer side will return null. Both apps are running on TomCat. For instance, an XML document of size 1.73mb will not make it through.

like image 480
l3dx Avatar asked May 31 '10 12:05

l3dx


People also ask

Is there a maximum size for content of an HTTP POST?

The default value of the HTTP and HTTPS connector maximum post size is 2MB. However you can adjust the value as per your requirement. The below command to set the connector to accept maximum 100,000 bytes. If the http request POST size exceeds the 100,000 bytes then connector return HTTP/1.1 400 Bad Request.

What is the limit for Get URL and POST payload?

Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs. If you are using the GET method, you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path.

What is POST data length?

The POST data length is the entire length of the POST data payload. Query string length violation. A query string length violation occurs when the incoming request contains a query string that exceeds the acceptable length defined in the security policy.

What is Max POST size in Tomcat server XML?

By default Tomcat limits POST data to 2 MB. This limit can cause an issue when you use rule sets, which can post data greater than this limit. To disable the POST limit in Tomcat, you can add the maxPostSize="-1" attribute to the <Connector> element of the server. xml configuration file.


3 Answers

As per this the default is 2 MB for your <Connector>.

maxPostSize = The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

Edit Tomcat's server.xml. In the <Connector> element, add an attribute maxPostSize and set a larger value (in bytes) to increase the limit.

Having said that, if this is the issue, you should have got an exception on the lines of Post data too big in tomcat

For Further Info

like image 117
JoseK Avatar answered Oct 12 '22 23:10

JoseK


There is no defined maximum size for HTTP POST requests. If you notice such a limit then it's an arbitrary limitation of your HTTP Server/Client.

You might get a better answer if you tell how big the XML is.

like image 42
Morfildur Avatar answered Oct 12 '22 22:10

Morfildur


There may be a limit depending on server and/or application configuration. For Example, check

like image 1
František Žiačik Avatar answered Oct 12 '22 22:10

František Žiačik