BGS2T Question - How to read a response body after an HTTP post | Telit Cinterion IoT Developer Community
October 29, 2019 - 12:18pm, 1628 views
Hi there,
When I post to the ubidots server, I get the following response from the modem after the AT^SISO=2 command: (After following the steps for an http post)
13:09:13]AT^SISO=2
13:09:13]OK
13:09:16]^SIS: 2, 0, 2201, "HTTP/1.1 200 OK"
13:09:16]^SISR: 2, 1
When I post the same data using an API tester, I receive the following feedback:
Response Headers
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 29 Oct 2019 11:08:38 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Allow: GET, POST, HEAD, OPTIONS
Vary: Origin, Cookie
Response Body
{"var1": [{"status_code": 201}], "var2": [{"status_code": 201}], "var3": [{"status_code": 201}], "var4": [{"status_code": 201}], "var5": [{"status_code": 201}], "var6": [{"status_code": 201}], "var7": [{"status_code": 201}], "var8": [{"status_code": 201}], "var9": [{"status_code": 201}], "var10": [{"status_code": 201}]}
Is there any way to read the response body using the BGS2T modem?
Thank you!
-Hermann
Hello,
You should be able to read the response with AT^SISR command. For instance AT^SISR=2,1000.
Regards,
Bartłomiej
Hi Bartlomiej,
I have used AT^SISR=2,1000 after AT^SISO=2 and it works like a charm. Thank you very much!
Kind regards,
Hermann