Skip to content
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

[Feature] Add PostToHTTP command for HTTP POST #4446

Closed
TD-er opened this issue Jan 3, 2023 · 4 comments · Fixed by #4465
Closed

[Feature] Add PostToHTTP command for HTTP POST #4446

TD-er opened this issue Jan 3, 2023 · 4 comments · Fixed by #4465
Labels
Category: Rules Related to the rule engine Type: Feature Request Add a completely new feature (e.g. controller/plugin)

Comments

@TD-er
Copy link
Member

TD-er commented Jan 3, 2023

As mentioned on the forum

A new command, like SendToHTTP, but then to make a HTTP POST call.

Not sure yet about what parameters it may need as the arguments of what to POST may be a bit tricky.
Perhaps it can be a single string? (N.B. the URL is of course also a separate string)

@TD-er TD-er added Type: Feature Request Add a completely new feature (e.g. controller/plugin) Category: Rules Related to the rule engine labels Jan 3, 2023
@BasvanH
Copy link

BasvanH commented Jan 6, 2023

I need this very much, when you want to update an item in OpenHAB thru the REST API it requires the HTTP method to be POST.

I want to use a ESPEasy rule to update an OpenHAB item, currently the SendToHTTP command uses the HTTP GET method.

https://www.openhab.org/docs/configuration/restdocs.html

@tonhuisman
Copy link
Contributor

@BasvanH I have created a PR implementing the PostToHTTP command, can you test from the Github Actions build (once that's finished) to see if this fits your usage scenario?

@BasvanH
Copy link

BasvanH commented Jan 16, 2023

@tonhuisman, great, yes I will conduct tests and report back here.

@BasvanH
Copy link

BasvanH commented Jan 18, 2023

@tonhuisman, Ive successfully used the PostToFTTP in a rule to make POST requests to the OpenHAB REST API.

PostToHTTP <IP>,8080,/rest/items/Item_Name,'Content-Type:text/plain',ON
2688013: ACT : PostToHTTP <IP>,8080,/rest/items/Item_Name,'Content-Type:text/plain',ON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Rules Related to the rule engine Type: Feature Request Add a completely new feature (e.g. controller/plugin)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants