Incorrect Content-Length Header on POSTs

The POST data api (https://api.sensor.community/v1/push-sensor-data/) responds with an incorrect Content-Length header.
It currently responds with -1 instead of the length of the body content.

Unfortunately this breaks the ESPHome http_request component as it expects the correct content length.

Is it possible to have this corrected please?
Thanks

Am I asking in the wrong forum?

Welcome !

What kind of firmware are you using to send the POST request with ?
The POST is working perfectly with our firmware and I have already send POST with LoRaWAN hooks, Raspberry PI etc.

I can remember that sometimes you have to write a leading 0 or a leading byte in the POST (or a closing…). It could be a reason.

Please send me you code here.

Hi @pjg
I’m using ESPHome and it’s a known issue that in versions of ESPHome’s http_request component >5.5 can’t cope with Content-Length=0 in reply headers.
I currently have a workaround by using an earlier version of ESPHome.
I’ve also raised it with ESPHome in Github as it’s the combination of this bug and the ESPHome bug that’s giving me grief.

Is there a bug reporting system for sensor.community - I can only see Feature Requests?

Thanks

Please ignore this. It was my misunderstanding of chunked encoding.
A fix to ESPHome has cured it

1 Like