I’m using Jersey to send HTTP POST requests like this:
MultivaluedMap<String, String> form = new MultivaluedMapImpl();
form.add("body", "Here there is my text");
ClientResponse response = resource.queryParams(form).type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class);
When I put in body element, text that its length is 7999 or less – the response from the other side is ok
However, if I try with length of the text of more than 8000 the response from the other side is:
returned a response status of 400 Bad Request
I tried to submit the same call from CURL in command line, and it passes fine.
The response status is 400
Could it be something in Jersey/Tomcat configuration?
I tried to add to tomcat connector maxHttpHeaderSize="65536" but it didn’t help
Change also the Jersey command to be:
Instead of the way that you sent it with query params.