I would like to determine te size (in bytes?) of a HTTP POST transaction to be submitted. I have a form with a lot of form data. When all fields are filled with the maximum number of characters (for example all 9's) and the form gets submitted through a POST method, there's no problem, and all data gets saved.
When I replace all characters (9's) by spaces, I get a 404 after submitting the form.
I'm assuming that I'm sending too much data here. I think the spaces are being converted to %20, so the amount of bytes posted are tripled.
I would like to determine the size of the HTTP POST transaction, before submitting the form, so I can display a message to the user if the size is over some limit. I'd prefer to use JavaScript.
Does anyone know how to determine this?
A 404 error indicates that the location you are trying to post to does not exist, i.e. the URL may be malformed when you post with spaces.
Can you show us the code?
There's no limit for POST data (except if it's a WCF service or something) - I would look if you are correctly posting the FORM data since 404 is a PAGE NOT FOUND error and has nothing to do with the format...
Any more code to show maybe?