Hi,
I have the following situation.
A driver acting as server via smart-serial.
If a request is made via postman or curl.
A response with 200 and the json body will be visible on the stream viewer.
On postman a status 200 will be available but it will keep waiting until timeout or until the driver is stopped.
Similar with curl.
Tried to close the connection with a close action but i may be missing something.
Could you please give me some advice in how to implement this feature?
Thanks in advance.
If it's unnecessary to implement a full-fledged HTTP Web server, a minimal response for a request should be like this:
HTTP/1.1 200 OK
Content-Length: 13
Content-Type: text/plain; charset=utf-8
My answer
The Content-Length should be the body's length, and there must be a new line between the headers and the body. Notice this solution is not intended to be a robust server communication channel but more for occasional confirmation and lightweight responses.
Thank you very much for the feedback.
Thank you @Gelber Mahecha fixing the HTTP structure worked great!!