Http request

Trying to figure out how to execute this command in openhab. when i type it into my chrome browser it works fine:[Speak(‘testing 1 2 3’)]&key=xxxxx

This is the statement in the rule:

sendHttpPostRequest(“[Speak(‘testing 1 2 3’)]&key=xxxxx”)

I get this error:

Error during the execution of rule ‘speech test’: Invalid uri ‘[Speak(‘testing 1 2 3’)]&key=xxxxx’: Invalid query

Also tried it as an item and same errors. added ports to firewall and even disabled the firewall. no luck.

Any thoughts??


When you put that URL into your browser it is doing an HTTP GET, not an HTTP POST. Try sendHttpGetRequest.

thanks for the response.

Tried it with get as well same thing happens. Also , tested this on another pc using chrome and it works so i know the firewall is not stopping it. i was thinking that all the quotes and brackets might be messing it up. i have no ideal though. lol.


You can try escaping them using URL encoding.

For example, replace ‘[’ with '%5b".

that worked!!! Thanks so much.