-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of a POST request as a function #134
Comments
For Form data - spec:
name: get_your_data
description: Get your data
parameters:
type: object
properties:
dummy:
type: string
description: Nothing.
function:
type: rest
method: POST
resource: "https://YOUR_POST_API"
payload: "foo=foo&bar=bar"
headers:
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
value_template: '{{value_json}}' JSON - spec:
name: get_your_data
description: Get your data
parameters:
type: object
properties:
dummy:
type: string
description: Nothing.
function:
type: rest
method: POST
resource: "https://YOUR_POST_API"
payload: >-
{"foo": "foo", "bar": "bar"}
headers:
"Content-Type": "application/json; charset=utf-8"
value_template: '{{value_json}}' |
Thanks! So in that case no templating is available for the payload? Like
This would be nice to have. |
[#134] Add "payload_template" in "rest" and "scrape" function
I just realized that rest and scrape of HA doesn't support I added |
Works like a charm! Thanks a lot! |
Thanks for this great project! I am trying to do a POST request as a function, but can you provide an example of how to do this? Thanks!
The text was updated successfully, but these errors were encountered: