No data, but only header in AJAX POST for IE or Edge

So in my scenario, I use AJAX to send data to the server. Here is my AJAX code:

$.post('change_password',"username"+username+"password"+$('#Confirm_password').val()+";",function(data,status){
  alert("Data: " + data + "\nStatus: " + status);
  if(status=="success"){
       if(data=="set_success"){ 
            alert("Password Change Success");
       }                        
  }
});

I read a lot of articles that say that IE sends a message in 2 tcp packets (1 header and 1 data content). So on my server side. If I get only 1 reception, I can only get the header, but not the data that I really need. I will try some solution, for example add a meta tag, for example

<meta charset="utf-8">

or

<meta http-equiv="x-ua-compatible" content="IE=9" >

But for me it doesn’t work for IE to send a message in only 1 packet instead of 2.

But this is strange. On other forums, people say that this is a bug for IE10 or 11. But I'm trying to reduce my IE to IE9, it still does not work.

Does anyone have an idea? Stuck in this problem for almost 5 days.

And also, I have a server like this:

if((err = netconn_recv(conn, &inbuf)) == ERR_OK) {

      netbuf_first(inbuf);

      do{

          netbuf_data(inbuf, (void**)&buf, &buflen);
          strcat(recieve_buffer, buf);
          }while(netbuf_next(inbuf) >= 0);
}

, LWIP- tcp/ip. netconn_recv. , IE. . " ( )". ( ). , 2 tcp-?

/* for browser like IE. Recieve the netbuf again to get content */
              /*
if(strcmp(http_body,"") == 0){

    if((err = netconn_recv(conn, &inbuf)) == ERR_OK) {
        netbuf_first(inbuf);
        do{
            netbuf_data(inbuf, (void**)&http_body, &buflen);
        }while(netbuf_next(inbuf) >= 0);
    }
    netconn_write(conn,&http_body[0], strlen(http_body), NETCONN_COPY);

}
else{
    netconn_write(conn,&http_body[0], strlen(http_body), NETCONN_COPY);
}
   */
+4

Source: https://habr.com/ru/post/1652538/


All Articles