macaroni

http

Description:
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):

# 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:

Status: ✅ IMPLEMENTED