Add put as method (#2803)

This commit is contained in:
Fabian Affolter 2017-06-13 07:27:31 +02:00 committed by Paulus Schoutsen
parent 4f511dd7a4
commit 736141df63
2 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,7 @@ Configuration variables:
- **[service_name]** (*Required*): The name used to expose the service. E.g. in the above example would it be ` rest_command.example_request`.
- **url** (*Required*): The URL (support template) for sending request.
- **method** (*Optional*): HTTP method (get, post, put, delete). Default is get.
- **method** (*Optional*): HTTP method to use (`get`, `post`, `put`, or `delete`). Defaults to `get`.
- **payload** (*Optional*): A string/template to send with request.
- **username** (*Optional*): The username for HTTP authentication.
- **password** (*Optional*): The password for HTTP authentication.

View File

@ -28,6 +28,7 @@ Configuration variables:
- **resource** (*Required*): The resource or endpoint that contains the value.
- **name** (*Optional*): Name of the REST switch.
- **method** (*Optional*): HTTP method to use (`post` or `put`). Defaults to `post`.
- **body_on** (*Optional*): The body of the POST request that commands the switch to become enabled. Default is "ON". This value can be a [template](/topics/templating/).
- **body_off** (*Optional*): The body of the POST request that commands the switch to become disabled. Default is "OFF". This value can also be a [template](/topics/templating/).
- **is_on_template** (*Optional*): A [template](/docs/configuration/templating/#processing-incoming-data) that determines the state of the switch from the value returned by the GET request on the resource URL. This template should compute to a boolean (True or False). If the value is valid JSON, it will be available in the template as the variable `value_json`. Default is equivalent to `'{% raw %}{{ value_json == body_on }}{% endraw %}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches .