HTTP POST connection close content problem

6 thoughts on “HTTP POST connection close content problem

  1. I’m sending to .net web service, I’ve initialized the modem with the following:

    APN: AT+CGDCONT=2,”IP”,”mobinilweb”,””,0,0

    Activate PDP context APN profile: AT+CGACT=1,2

    Context Profile Activation: AT#SGACT=2,1

    HTTP Configuration: AT#HTTPCFG=0,”MyServerIPAddress”,ServicePort

    Now I’m sending the following:

    AT#HTTPSND=0,0,”ServiceAddress”,DataLength,0

    the upper command when I use WireShark I found it sends me a HTTP POST header cantains Connection: close while it must be Connectio: Keep-Alive, how come the modem sends to the server command to close the connection while the data didn’t sent yet?

    Also when I’m sending the data, if I sent the below data:


    <?xml version=””1.0″” encoding=””utf-8″”?>
    <soap12:Envelope xmlns:xsi=””http://www.w3.org/2001/XMLSchema-instance””
    xmlns:xsd=””http://www.w3.org/2001/XMLSchema””
    xmlns:soap12=””http://www.w3.org/2003/05/soap-envelope””>
    <soap12:Body>
    <SendMsg xmlns=””http://Consultix-Egypt.com/””>
    <msg>012497003309733,30.1231,31.2154</msg>
    </SendMsg>
    </soap12:Body>
    </soap12:Envelope>

    Idon’t receive anything but if I put a HTTP POST header like below:

    POST /Service.asmx HTTP/1.1
    Host: 197.45.132.133
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: 103
    Connection: Keep-Alive

    <?xml version=””1.0″” encoding=””utf-8″”?>
    <soap12:Envelope xmlns:xsi=””http://www.w3.org/2001/XMLSchema-instance””
    xmlns:xsd=””http://www.w3.org/2001/XMLSchema””
    xmlns:soap12=””http://www.w3.org/2003/05/soap-envelope””>
    <soap12:Body>
    <SendMsg xmlns=””http://Consultix-Egypt.com/””>
    <msg>012497003309733,30.1231,31.2154</msg>
    </SendMsg>
    </soap12:Body>
    </soap12:Envelope>

    I receive on WireShark the HTTP POST header twice one from the HTTPSND command and the one I sent but without the wolhe data, the upper code half of it unavailable!

    I still can’t figure out how to use AT#HTTPSND command.

    1. AT#HTTPSND:

      Note: the HTTP request header sent with #HTTPSND always contains the “Connection: close” line, and it can not be removed.

      1. I read this note but I didn’t understand why it has connection close and the most important thing how can I send the data? Does the command has certain timeout? And if not so what this command use before in the first place?

        1. Connection-close is to close the HTTP connection after the data transfer is done from the server back to the client.

  2. OK, so how do I terminate my session with to make the server know that I’m finished sending? Is it Ctrl+Z?

    Also, shall but the HTTP header in my sent data too or I just send the data directly? Can please provide me an example on how the data to be sent after AT#HTTPSND?

  3. I got it finally, I sent the data directly and noticed that the module rounded it with the xml shape so the web service recognized it.