ThingHTTP server response header using "Transfer-Encoding: chunked"
Zachariah Belding
le 15 Déc 2022
Dernière activité Réponse par Zachariah Belding
le 15 Déc 2022
When making a ThingHttp request via POST, the server response header does not include: "Content-Length:". Instead it is using "Transfer-Encoding: chunked". This makes it dificult to confirm that the entire response has been recieved. Any way to change this?
21:09:55.812 -> POST /apps/thinghttp/send_request HTTP/1.1
21:09:55.812 -> Host: api.thingspeak.com
21:09:55.812 -> Content-Type: application/x-www-form-urlencoded
21:09:55.812 -> Content-Length: 60
21:09:55.812 ->
21:09:55.812 -> headers=false&api_key=[removed]&message=Arduino Reset
21:09:55.906 ->
21:09:57.040 ->
21:09:57.040 ->
21:09:57.040 -> HTTP/1.1 200 OK
21:09:57.040 -> Date: Thu, 15 Dec 2022 02:09:57 GMT
21:09:57.040 -> Content-Type: text/html; charset=utf-8
21:09:57.040 -> Transfer-Encoding: chunked
21:09:57.040 -> Connection: keep-alive
21:09:57.040 -> Status: 200 OK
21:09:57.040 -> Cache-Control: max-age=0, private, must-revalidate
21:09:57.040 -> X-Request-Id: 798bbb62-da97-4ff8-a15b-c60b68fd60d3
21:09:57.040 -> ETag: W/"408e73c03e9c23fc2318c396c21c09e8"
21:09:57.040 ->
21:09:57.040 -> 2d
21:09:57.040 -> Congratulations! You've fired the alert event
21:09:57.040 -> 0
21:09:57.040 ->
2 commentaires
Date décroissanteThere is no control for the headers used in ThingHTTP, though you can ask ThingSpeak to reduce the headers sent to a device in some cases.
I would guess that the client that is accepting the ThingHTTP request should be able to do the right HTTP thing. Are you writing a custom receiver/client? Does it run on a device?
If you really needed to send length information, you can be able to calculate the length in a MATLAB analysis, and then use webread and webwrite to send the response to your device or whomever else is listening. You can control the headers explicitly in MATLAB.
Connectez-vous pour participer