diff --git a/docs/api/rest.md b/docs/api/rest.md index 85ee77a6..fc9c5b4a 100644 --- a/docs/api/rest.md +++ b/docs/api/rest.md @@ -568,6 +568,19 @@ curl -X POST -H "Authorization: Bearer ABCDEFGH" \ http://localhost:8123/api/states/sensor.kitchen_temperature ``` +Sample `python` command using the [Requests](https://requests.readthedocs.io/en/master/) module: + +```shell +from requests import post + +url = "http://localhost:8123/api/states/sensor.kitchen_temperature" +headers = {"Authorization": "Bearer ABCDEFGH", "content-type": "application/json"} +data = {"state": "25", "attributes": {"unit_of_measurement": "°C"}} + +response = post(url, headers=headers, json=data) +print(response.text) +``` +