Get & Post via http | Telit Cinterion IoT Developer Community
February 10, 2018 - 11:31am, 3655 views
Hai. Newbie here. I currently working on how to get and post via http. However, it doesn't work. I'm using io.adafruit as the address. When i post, i received this
at^sisw=0,4,1 OK ^SISW: 0,2 ^SIS: 0,0,2200,"HTTP POST: https://io.adafruit.com/api/v2/camellia/feeds/testpost" ^SIS: 0,0,8002,"HttpHTTP POST: IllegalArgumentException Socket-Error:14"
when i used get,
^SIS: 0,0,14,"An established connection was aborted, possibly due to a data transmission time-out or protocol error"
Do i misunderstood the concept? I expected to post with at command, but get the error. Where should i type or insert the data? Do i need an extra plattform to work with it? While, for the get, i couldn't figure out why the connection is aborted. I'm using the same link also.
Hello,
Could you please provide the exact module type and firmware version - you can get it with ATI1 command.
Please also paste the AT commands that you use for configuration and connection.
Have you also tried to test with other sites or with http protocol for verification whre the problem could be?
Thanks and best regards,
Bartłomiej
hai! I'm using ehs6 REVISION 03.001.
This is the recent command that i tried to post data and get a http code 404 error.
at^siss=2,srvType,"http"
OK
at^siss=2,conId,2
OK
at^siss=2,address,"https://io.adafruit.com/api/v2/camellia/feeds/teststore/data"
OK
at^siss=2,cmd,"post"
OK
at^siss=2,hcContent,"value=123"
OK
at^siss=2,hcContLen,"0"
OK
at^siso=2
OK
^SIS: 2,0,2200,"Http io.adafruit.com:443"
^SIS: 2,0,200,"HTTP-CODE: 404"
I'm confuse on the data format packet and the url syntax which idk where the data format should be applied and post on adafruit io.
Hello,
Have you tried to test this with curl for example to check it there is everything correct on the server?
Regards,
Bartłomiej
Hai.
U mean from hcContent? I tried something like this "{'value': '44'}" but nothing works. I can't put another pair of "" inside "". It will response with error. I wonder which part went wrong. Is my url need to be specifically insert json or other text format syntax? Or the hcContent? I feel like something missing.
Hai!
I had success to post the data. My url is the cause. Thanks anyway. For further, if i want to post to a group(multiple feeds), i just change the url?
Hello,
Great that it's working!
As far as I know From HTTP perspective with POST you just send the POST contents to a single address.
If it is a chat service or something like that and sends your message to a group based on URL then it is another story.
Regards,
Bartłomiej