Error 400 when getting Item State in browser or with python requests


sudo docker run --rm curlimages/curl:8.00.1

Output: 19.1 °C


when I enter this URL:

I get a 400 with no further information:

Why is this? I can’t figure out the difference between curl and the browser. The problem is the same on my own instance.

The problem in the browser is the Accept header.
While curl sets it to Accept:*/* the browser uses text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8.
Using an extension like tamper data you can modify the header that is being send by the browser. Doing so will return the state and display it in the browser.