Kërkoni te Asistenca

Shmangni karremëzime gjoja asistence. S’do t’ju kërkojmë kurrë të bëni një thirrje apo të dërgoni tekst te një numër telefoni, apo të na jepni të dhëna personale. Ju lutemi, raportoni veprimtari të dyshimtë duke përdorur mundësinë “Raportoni Abuzim”.

Mësoni Më Tepër

My site try to post a large ajax request to server, the request is rejected. Tested the same scenario in IE and Chrome, and both of them working.

  • 1 përgjigje
  • 1 e ka hasur këtë problem
  • 14 parje
  • Përgjigjja më e re nga philipp

more options

In my site, I had a button that will trigger a Ajax post to my server. When my data is with the content-length "32109", the post will rejected with a empty body response with xhr.statusText "error". If my content-length is "27549", i'm able to post successfully to my server.

Tested the same scenario in IE and Chrome and both working fine with content-length "32109".

Code:


$.ajax({

           url: "update",
           dataType: "json",
           data: {
               parameter_data: JSON.stringify({
                   meta_datas: metaDataObj,
                   attributesValues: this.data
               })
           },
           type: "POST",
           success: function(data) {
               ...
           },
           error: function (xhr, desc, err) {
               ...
           }
       });


Request headers:


User-Agent:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0" Accept:"application/json, text/javascript, */*; q=0.01" Accept-Language:"en,zh;q=0.8,sq;q=0.6,zh-TW;q=0.4,en-US;q=0.2" Accept-Encoding:"gzip, deflate" Content-Type:"application/x-www-form-urlencoded; charset=UTF-8" X-Requested-With:"XMLHttpRequest" Content-Length:"32109" Connection:"keep-alive" Pragma:"no-cache" Cache-Control:"no-cache"

The response body is empty.

xhr:

- state = rejected
- statusText = error

May i know why the request is rejected? Note: The request never reach the server

In my site, I had a button that will trigger a Ajax post to my server. When my data is with the content-length "32109", the post will rejected with a empty body response with xhr.statusText "error". If my content-length is "27549", i'm able to post successfully to my server. Tested the same scenario in IE and Chrome and both working fine with content-length "32109". Code: --------------------------------------------------------------------------------------------------------------------------------------- $.ajax({ url: "update", dataType: "json", data: { parameter_data: JSON.stringify({ meta_datas: metaDataObj, attributesValues: this.data }) }, type: "POST", success: function(data) { ... }, error: function (xhr, desc, err) { ... } }); Request headers: --------------------------------------------------------------------------------------------------------------------------------------- User-Agent:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0" Accept:"application/json, text/javascript, */*; q=0.01" Accept-Language:"en,zh;q=0.8,sq;q=0.6,zh-TW;q=0.4,en-US;q=0.2" Accept-Encoding:"gzip, deflate" Content-Type:"application/x-www-form-urlencoded; charset=UTF-8" X-Requested-With:"XMLHttpRequest" Content-Length:"32109" Connection:"keep-alive" Pragma:"no-cache" Cache-Control:"no-cache" The response body is empty. xhr: - state = rejected - statusText = error May i know why the request is rejected? Note: The request never reach the server
Foto të bashkëngjitura ekrani

Krejt Përgjigjet (1)

more options

hi, support.mozilla.org is intended for end-user support. if you have a question regarding web development please refer to Where to go for developer support instead. thank you for your understanding!