Add headers to REST command response documentation (#39938)

This commit is contained in:
Jan-Philipp Benecke 2025-07-09 20:37:37 +02:00 committed by GitHub
parent 4be1d24940
commit c6775c1b25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,7 +100,8 @@ rest_command:
### Using REST command Response in automations
REST commands provide an action response in a dictionary containing `status` (containing the HTTP response code) and `content` containing the response body as text or JSON. This response can be accessed in automations using [`response_variable`](/docs/scripts/perform-actions#use-templates-to-handle-response-data).
REST commands provide an action response in a dictionary containing `status` (containing the HTTP response code), `content` containing the response body as text or JSON and `headers` containing the response headers.
This response can be accessed in automations using [`response_variable`](/docs/scripts/perform-actions#use-templates-to-handle-response-data).
The following example shows how the REST command response may be used in automations. In this case, checking the [Traefik API](https://doc.traefik.io/traefik/operations/api/) for errors.