diff --git a/atom.xml b/atom.xml index 912fd662a0..714cb1aacb 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ - http://localhost:8123/api/states/binary_sensor.radio + -H "Content-Type: application/json" \ + http://localhost:8123/api/states/binary_sensor.radio { "attributes": { "friendly_name": "Radio" @@ -161,7 +162,7 @@ print(response.text)diff --git a/components/notify.mqtt/index.html b/components/notify.mqtt/index.html index 339502f657..ff5e0d386b 100644 --- a/components/notify.mqtt/index.html +++ b/components/notify.mqtt/index.html @@ -107,6 +107,7 @@$ http -v POST http://localhost:8123/api/states/binary_sensor.radio \ - x-ha-access:YOUR_PASSWORD state=off \ + x-ha-access:YOUR_PASSWORD content-type:application/json state=off \ attributes:='{"friendly_name": "Radio"}'diff --git a/components/sensor.http/index.html b/components/sensor.http/index.html index 30c2ee49f4..39b4ee22fc 100644 --- a/components/sensor.http/index.html +++ b/components/sensor.http/index.html @@ -112,7 +112,8 @@ You should choose a unique device name (DEVICE_NAME) to avoid clashes with other$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ -d '{"payload": "Test message from HA", "topic": "home/notification"}' \ http://IP_ADDRESS:8123/api/services/mqtt/publishFor a quick test
curl
can be useful to “simulate” a device.-$ curl -XPOST -H "x-ha-access: YOUR_PASSWORD" \ +@@ -123,7 +124,8 @@ You should choose a unique device name (DEVICE_NAME) to avoid clashes with other$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ -d '{"state": "20", "attributes": {"unit_of_measurement": "°C", "friendly_name": "Bathroom Temp"}}' \ http://localhost:8123/api/states/sensor.bathroom_temperature$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ - http://localhost:8123/api/states/sensor.bathroom_temperature + -H "Content-Type: application/json" \ + http://localhost:8123/api/states/sensor.bathroom_temperature { "attributes": { "friendly_name": "Bathroom Temp", diff --git a/components/switch.mystrom/index.html b/components/switch.mystrom/index.html index 09493c6a16..ca1c9ccdd4 100644 --- a/components/switch.mystrom/index.html +++ b/components/switch.mystrom/index.html @@ -113,7 +113,7 @@Check if you are able to access the device located at
http://IP_ADRRESS
. The details about your switch is provided as a JSON response.-$ curl -X GET http://IP_ADDRESS/report +$ curl -X GET -H "Content-Type: application/json" http://IP_ADDRESS/report { "power": 0, "relay": false diff --git a/developers/rest_api/index.html b/developers/rest_api/index.html index fa1e1de041..882688026b 100644 --- a/developers/rest_api/index.html +++ b/developers/rest_api/index.html @@ -103,6 +103,7 @@@@ -154,7 +155,8 @@ You can appendcurl -X GET \ -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ http://IP_ADDRESS:8123/ENDPOINT?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -190,7 +192,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/ +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -212,7 +215,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/config +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/config?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -234,7 +238,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/discovery_info +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/discovery_info?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -260,7 +265,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/bootstrap +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/bootstrap?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -291,7 +297,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/events +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/events?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -331,13 +338,17 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/services +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/services?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
commands:-$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/history/period/2016-02-06 +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ + http://localhost:8123/api/history/period/2016-02-06-@@ -367,7 +378,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/history/period/2016-02-06?filter_entity_id=sensor.temperature +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ + http://localhost:8123/api/history/period/2016-02-06?filter_entity_id=sensor.temperature?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -397,7 +409,8 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/states +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/states?api_password=YOUR_PASSWORD
to any url to log in aut@@ -417,6 +430,7 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ - http://localhost:8123/api/states/sensor.kitchen_temperature + -H "Content-Type: application/json" \ + http://localhost:8123/api/states/sensor.kitchen_temperature?api_password=YOUR_PASSWORD
to any url to log in aut@@ -428,8 +442,9 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ http://localhost:8123/api/error_log?api_password=YOUR_PASSWORD
to any url to log in autSample
curl
command:-@@ -472,6 +487,7 @@ You can append$ curl -X GET -H "x-ha-access: YOUR_PASSWORD"\ - http://localhost:8123/api/camera_proxy/camera.my_sample_camera?time=1462653861261 -o image.jpg +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ + http://localhost:8123/api/camera_proxy/camera.my_sample_camera?time=1462653861261 -o image.jpg?api_password=YOUR_PASSWORD
to any url to log in aut@@ -539,6 +555,7 @@ You can append$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ -d '{"state": "25", "attributes": {"unit_of_measurement": "°C"}}' \ http://localhost:8123/api/states/sensor.kitchen_temperature?api_password=YOUR_PASSWORD
to any url to log in aut@@ -572,8 +589,8 @@ The result will include any changed states that changed while the service was be$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" \ -d '{"entity_id": "switch.christmas_lights", "state": "on"}' \ http://localhost:8123/api/services/switch/turn_ondiff --git a/developers/server_sent_events/index.html b/developers/server_sent_events/index.html index 74f6435529..7ea6250416 100644 --- a/developers/server_sent_events/index.html +++ b/developers/server_sent_events/index.html @@ -98,7 +98,8 @@$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \ - -d '{"template": "It is !"}' \ - http://localhost:8123/api/template + -H "Content-Type: application/json" \ + -d '{"template": "It is !"}' http://localhost:8123/api/templateThere are various ways to access the stream. One is
curl
:-diff --git a/sitemap.xml b/sitemap.xml index 4171c19f8a..0ad91a2fb9 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1701,26 +1701,26 @@$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/stream +$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \ + -H "Content-Type: application/json" http://localhost:8123/api/streamhttps://home-assistant.io/demo/frontend.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:06+00:00 https://home-assistant.io/demo/index.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:06+00:00 https://home-assistant.io/googlef4f3693c209fe788.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:06+00:00 https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:07+00:00 https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:07+00:00 https://home-assistant.io/static/mdi-demo.html -2016-06-04T12:35:26+00:00 +2016-06-04T15:39:07+00:00