0

Hi,

I am getting a "400 Bad HTTP request " error when form has large data.
I am using Ajax to make a request. I read that the max limit of the HTTP POST data limit varies from 2MB to 8MB that depends on the client and Server.But my data is about to 15Kb only.

What I was not able to understand that is there any limit for individual parameters also?

Let's say: I have two parameters which has to be sent to my Ajax request.

 refHttp.open('POST','main.do?param1='+para1+'&param2='+para2,true);

Data of the each parameter para1 and para2 may be lager(around to 6KB) sometimes.

Is there any restriction on max data size of the individual parameters? Is there any other alternative to send large data to POST method?

Thanks.

Rama Rao M
  • 2,961
  • 11
  • 44
  • 64
  • I think such limitations should not be, because generally server "does not know" how to interpret post data; it may be urlencoded, or multipart, or even something more exotic like JSON or XML. It is unlikely that server parses data 'on the fly' to check fields. You may trigger any security filter (it depends on your server side language). BTW what server side language do you use? – Vitalii Jan 31 '13 at 14:02
  • I am using SAP BSP as server side language... – Rama Rao M Jan 31 '13 at 14:04
  • It's the para1/para2 - see this question and move them to the body instead. http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url Short answer - de facto limit of 2000 characters – Paul Collingwood Jan 31 '13 at 14:41

1 Answers1

3

If you send your parameters as part of the url you will suffer that limitation.

In your case, use the send method of the XMLHTTPRequest object, so as it is sent in the body part of the http request:

refHttp.open('POST','main.do',true);
refHttp.send('param1='+para1+'&param2='+para2);