Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Cerca nel supporto

Attenzione alle mail truffa. Mozilla non chiederà mai di chiamare o mandare messaggi a un numero di telefono o di inviare dati personali. Segnalare qualsiasi attività sospetta utilizzando l'opzione “Segnala abuso”.

Learn More

Questa discussione è archiviata. Inserire una nuova richiesta se occorre aiuto.

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 risposta
  • 1 ha questo problema
  • 14 visualizzazioni
  • Ultima risposta di 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
Immagini allegate

Tutte le risposte (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!