httpDescription:
The http executor executes an HTTP request via GET or POST.
Parent: execute, then, else
Value (simple form): string specifying the URL
Value (key/value form):
http: string, required, specifying uri (can be http or https)method: string, optional, specifying the HTTP method (e.g. GET, or POST) to be appended to the file (default: GET)headers: string or sequence of string, optional, specifying the HTTP headers (default: null)content: string, optional, specifying the text to be written into the file (default: null)# simple form
- http: (string)
# simple example
- http: 'https://example.com/path'
# key/value form
- http: (string)
method: (string, optional)
headers: (string or sequence of strings, optional)
content: (string, optional)
# key/value example
- http:
uri: 'https://example.com/post'
method: POST
headers:
- content-type: multipart/form-data
content: '{postContent}'
EXAMPLE:
# get the current weather forecast
commands:
- triggers:
- what's the weather
execute:
- http: 'https://api.msn.com/weather/current?apikey={apiKey}&ocid=msftweather&appId={appId}&wrapodata=false&locale=en&lat={lat}&lon={lon}&units={units}'
- json: '{http.response}'
- speak: |
It's currently {responses[0].weather[0].current.cap} and {responses[0].weather[0].current.temp} degrees in {responses[0].source.location.Name}
Additional Information:
http executor executes, subsequent executors in the same execution context can access the http response:
{http.response} - the text based response (see: json executor for parsing)Status: ✅ IMPLEMENTED