Can you give a full example of the at commands needed to do a http get on an hl7800. I am able to issue the get ok but I cannot work out how to get the response - I know it’s working by looking at logs on the website but I need to see the response, or at least the response code on the modem
you can see here:
I am using HTTP, not HTTPS
I am currently issuing this command AT+KHTTPGET=2,“/api/get_test”
the modem responds with CONNECT
(I know at this stage that the GET has worked)
What do I send to the modem to retrieve the HTTP response?
For using http instead of https, you need to set +httpcfg <http_version> to zero.
+khttpGET is for getting data from HTTP server
The content should appear automatically
Nothing appears though. Do I need to set up some headers ?
no, i don’t think so
Do you see “+KHTTP_IND: 1,1” ?
AT+KCNXCFG=1,"GPRS","CMHK"
OK
AT+KCNXPROFILE=1
OK
AT+KHTTPCFG=1,"www.google.com",80,0,,,,,0
+KHTTPCFG: 1
OK
+KCNX_IND: 1,4,1
+KCNX_IND: 1,1,0
+KHTTP_IND: 1,1
AT+KHTTPGET=1,"/index.html"
CONNECT
HTTP/1.1 200 OK
this is what I get. The get works but I don’t see the http response.
AT+KHTTPCFG=1,“myurlhere”
+KHTTPCFG: 1
OK
+KHTTP_IND: 1,1
AT+KHTTPGET=1,“/test?api_key=xxxx&details=test&level=abc”
CONNECT
–EOF–Pattern–
OK
+KHTTP_IND: 1,1
+KHTTP_IND: 1,3
Have you tried other http server like google?
This is what happens when I follow your commands …
AT+KHTTPCFG=1,“www.google.com”,80,0,0
+KHTTPCFG: 1
OK
+KHTTP_IND: 1,1
AT+KHTTPGET=1,“/index.html”
CONNECT
then nothing happens until I enter the EOF string …
–EOF–Pattern–
OK
+KHTTP_ERROR: 1,5
+KHTTP_IND: 1,3
how about using profile 2?
How about using the latest firmware?
I have found the answer - all I needed was to add “,1” at the end of the KHTTPGET command, i.e
AT+KHTTPGET=1,“/api/test”,1
and the response comes back
Thanks