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.
There may be a limit depending on server and/or application configuration. For Example, check
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.
Yes there is 2MB max and it can be increased by configuration change like this. If your POST body is not in form of multipart file then you might need to add the max-http-post configuration for tomcat in the application yml configuration file.
spring:
servlet:
multipart:max-file-size: 10MB
multipart:max-request-size: 100MB
server:
tomcat:
max-http-post-size: 100000000 # max-http-form-post-size: 10MB for new version
You might need to add this for the latest sprintboot version ->
server: tomcat: max-http-form-post-size: 10MB
Source: Stackoverflow.com