5 Replies Latest reply: Apr 20, 2012 7:32 AM by Srdjan Savkovic RSS

Problem with HTTP GET (Telit modem)

Newbie

Hello. I am trying to use HTTP GET method on a Telit modem. I am successfull in establishing a connection to a socket (port 80) and getting a web page when I do this:

 

at#sd=1,0,80,"www.myserver.com",0,0

 

and then:

 

GET / HTTP/1.1

Host: www.myserver.com

Connection: keep-alive

 

BUT when I want to run a script by doing this:

 

GET / HTTP/1.1

Host: www.myserver.com/script.php?var1=A&var2=B

Connection: keep-alive

 

I get a page error.

 

What am I doing wrong? I want to be able to plug data in to the database using a simple GET with a URL that has parameters in it.

 

Thanks!

  • Re: Problem with HTTP GET (Telim modem)
    Newbie

    This is Ken Bednasz from Telit and I can help you.  I will need more details on which Telit product and software you are using (AT+CGMR).

     

    I have attached an example that should help you.

     

    I would also recommend sending your AT command log to TS-NorthAmerica@telit.com for technical support.  It would be good to review the AT command you are using.  We would also like to know where you purchased your module from so we can setup proper support channel for your design team.

    BR

    Ken

    • Re: Problem with HTTP GET (Telim modem)
      Newbie

      I have same problem with Telit GM862-Quad (sw. 07.03.600), and it make me crazy

       

      This is my request, it is same as in Kens attachment:

      GET / HTTP/1.1

      Host: www.google.com

      Connection: keep-alive

       

      in bytes:

      47 45 54 20 2F 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 77 77 77 2E 67 6F 6F 67 6C 65 2E 63 6F 6D 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 0D 0A

       

      When I connect Fiddler to IIS, to track traffic, and try to open my site from Telit, I notice that telit insert 0x00 in front of G, in GET.

       

      So, seems that Google receive these bytes:

       

      00 47 45 54 20 2F 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 77 77 77 2E 67 6F 6F 67 6C 65 2E 63 6F 6D 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 0D 0A

       

      and that is reason why I'm getting Bad Request.

       

      What to do about this?

       

      I'm executing AT&K0 command before AT#SKTD=...


  • Re: Problem with HTTP GET (Telit modem)
    Newbie

    I think the querystring parameters should be after the GET like so...

     

    GET /script.php?var1=A&var2=B HTTP/1.1

    Host: www.myserver.com

    Connection: keep-alive

    • Re: Problem with HTTP GET (Telit modem)
      Newbie

      Thanks, but I thing that params are optional. This also can't pass:

       

      GET /index.html HTTP/1.1

      Host: www.google.com

      Connection: keep-alive

       

      Complicated queries, also. Problem is byte 00 in front of G. I have to know is problem on Telit, or my development board, but seems there are many open issues about this theme and Telit GM862.

       

      Some people solve it by calling command "AT&K0", but didn't help in my case.