1

After try save long string get error HTTP Error 414. The request URL is too long.

How long string ex. 20 000 character shorten in the 5 small string?

First string = 0 - 4 000 Second string = 4001 - 8 000 .... .... Fifth string = 16 001 - 20 000

And all part add in function below...

$.ajax({
                type: "POST",
                url: "page.asmx/myService?callback=?",
                //async: false,
                data: { parameter: part },//add part here
                contentType: "application/json; charset=utf-8",
                dataType: "jsonp",
                jsonpCallback: jsonCallBackFunc,
                success: function(data){},

            });

After finish First part add second ....etc. Any if satment?

paris0000
  • 53
  • 11
  • This might help http://stackoverflow.com/questions/2891574/how-do-i-resolve-a-http-414-request-uri-too-long-error – Rajesh Mar 28 '16 at 12:56
  • If you HAVE to use a long URL with GET and you cant increase the limit server side you will have to make multiple requests. I think that your best bet would be to make the function recursive on success and keep an index. So, On success, call the same function, pass the index + 20,000, and substring part (e.g. `part.substring(index, part.length >= index + 20000 ? index + 20000 : part.length)`) – Marie Mar 28 '16 at 12:58
  • [This code](http://codepen.io/anon/pen/EKXGbe?editors=0010#0) shows what I meant. I would still read @Rajesh s link first though because this isn't going to be best practice. – Marie Mar 28 '16 at 13:17

0 Answers0