Gemalto is now part of the Thales Group, find out more.

You are here

BGS2T Question - HTTP post with header and body content with data exceeding 128 characters | Thales IoT Developer Community

November 1, 2019 - 9:32am, 3568 views

Hi there :)

 

I’m having trouble with HTTP post using the BGS2T with data of more than 120 characters, with headers and data content in the HTTP Post body.

After reading the documentation (page 256 of BGS2T AT command specification document) I understand this is due to the hcContLen setting that I need to set correctly and then to use the AT^SISW command.

I have attached screenshots of an example of the required implementation using APITester for simulating the http request and PTSV2 to confirm receiving the http post request.

 

HTTP Post request settings on API tester:

Result of http post received on PTSV2:

 Here is my current working method for more than 120 characters using a terminal program and the BGS2T modem:

AT 

OK

AT^SCFG="TCP/WithURCs","on" ^SCFG: "Tcp/WithURCs","on"

OK

AT^SICS=2,"conType","GPRS0"

OK

AT^SISS=2,"srvType","http"

OK

AT^SISS=2,"conId","2"

OK

AT^SISS=2,"alphabet","1"

OK

AT^SISS=2,hcMethod,1

OK

AT^SISS=2,"address","http://ptsv2.com/t/UBIDOTS/post"

OK

AT^SISS=2,"hcContent","{In computing POST is a request method supported by HTTP used by the World Wide Web By design the POST request method r}"

OK

AT^SISS=2,"hcProp","Content-Type: application/json"

OK

AT^SISO=2

OK

^SIS: 2, 0, 2201, "HTTP/1.1 200 OK"

^SISR: 2, 1

AT^SISR=2,1000 

^SISR: 2, 54

Thank you for this dump. I hope you have a lovely day!

OK

^SISR: 2, 2

Can you please assist me by providing an example AT command set for making an http post with more than 120 characters that also contains data content (body) and a header? 

(Perhaps by editing my working AT command in this thread) set to achieve this)

Thank you,

Kind regards,

Hermann