ELS61 R2 FW - POST not compliant with HTTP 1.1/REST | Telit Cinterion IoT Developer Community
July 20, 2018 - 3:38pm, 8750 views
Hello Team
We have been implementing posts to REST server that always replies with response code and a response body in application/json format.
Issue is that whenever there is a body in response modem acts like there is no data, unless code was 200. Which is incorrect due to HTTP 1.1.
Due to HTTP 1.1 documentation there can be a body if response code is 201: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Due to REST standard there can be specification of an error in body as well. Meaning you can send response with body almost any time.
This leads to the questions :
How can we retrieve the real response code of HTTP server?
Why is the body of HTTP response not included every time to ^SISR ?
Thank you
Hello,
The firmware that you have is up to date. It seems that the simple HTTP client on the module does not support this scenario.
I think that for now you need a workaround - on the module side you could use socket instead of http and then use your own http implementation - send your own header and get any reply that will come.
Best regards,
Bartłomiej
Thank you for answer
This is clearly not well coded HTTP/S client for a year 2018.
Not sure if this would help. As you can see we are using HTTPS. Socket implementation is on lower level which means maybe even TSL wont work ? If we would need to code entire HTTPS (TSL) packet exchange as well it is really not a viable option.
Is there any code we could use to get simmilar behavior ? Maybe example or public sample repository?
Documentation is a bit lacking this basic scenario.
Hello,
It is possible to establish a secure socket connection so you probably only need an HTTP layer. I don't think that we have any demo HTTP implementation to share. But I suppose that it should not be much complicated to implement the POST scenario - it's about constructing the proper HTTP header and interpreting the server response. For example please see this: https://code.tutsplus.com/tutorials/http-headers-for-dummies--net-8039
Regards,
Bartłomiej