Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions source/_components/rest_command.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rest_command:
{% configuration %}
service_name:
description: The name used to expose the service. E.g., in the above example, it would be 'rest_command.service_name'.
required: true
required: true
type: map
keys:
url:
Expand Down Expand Up @@ -59,14 +59,19 @@ service_name:
required: false
type: string
timeout:
description: Timeout for requests in seconds.
description: Timeout for requests in seconds.
required: false
type: string
defaut: 10
content_type:
description: Content type for the request.
required: false
type: string
verify_ssl:
description: Verify the SSL certificate of the endpoint.
required: false
type: boolean
default: true
{% endconfiguration %}

## {% linkable_title Examples %}
Expand All @@ -80,11 +85,12 @@ rest_command:
my_request:
url: https://slack.com/api/users.profile.set
method: POST
headers:
headers:
authorization: !secret rest_headers_secret
accept: 'application/json, text/html'
payload: '{"profile":{"status_text": "{{ status }}","status_emoji": "{{ emoji }}"}}'
content_type: 'application/json; charset=utf-8'
verify_ssl: true
```
{% endraw %}

Expand Down
6 changes: 3 additions & 3 deletions source/_components/sensor.rest.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ payload:
required: false
type: string
verify_ssl:
description: Verify the certification of the endpoint.
description: Verify the SSL certificate of the endpoint.
required: false
type: boolean
default: True
Expand Down Expand Up @@ -173,7 +173,7 @@ sensor:
Content-Type: application/json
```

The headers will contain all relevant details. This will also give you the ability to access endpoints that are protected by tokens.
The headers will contain all relevant details. This will also give you the ability to access endpoints that are protected by tokens.

```bash
Content-Length: 1024
Expand Down Expand Up @@ -234,7 +234,7 @@ This sample fetches a weather report from [OpenWeatherMap](http://openweathermap
sensor:
- platform: rest
name: OWM_report
json_attributes:
json_attributes:
- main
- weather
value_template: '{{ value_json["weather"][0]["description"].title() }}'
Expand Down
6 changes: 6 additions & 0 deletions source/_components/switch.rest.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ headers:
description: The headers for the request.
required: false
type: list, string
verify_ssl:
description: Verify the SSL certificate of the endpoint.
required: false
type: boolean
default: true
{% endconfiguration %}

<p class='note warning'>
Expand All @@ -98,6 +103,7 @@ switch:
is_on_template: '{{ value_json.is_active }}'
headers:
Content-Type: application/json
verify_ssl: true
```
{% endraw %}

Expand Down