A few things to note - It has special characters including = and + inside of the authenticity_token... how exactly should I pass the body to httpPost? Should I build the URLencoded string myself? If I pass in a map does Hubitat auto encode it?
@chuck.schwer any thoughts? The docs just say " body - The request body" so it's really hard to know how I should be specifying it...
That doesn't really answer the question... I know strings have to be in quotes. My point is do I need to URL encode it myself? Should I be combining the parameters with & or should I just build a map and hubitat does it for me? I know that strings need to be in quotes, my question is, how does Hubitat encode a post body?
I appreciate the help, but from my experience sendHubAction works a lot differently than httpPost. If you look at Garadget Support for example you'll see they are URL encoding the variables... Your example doesn't include any values that would need to be URL encoded so it would work regardless
You can pass a map as the body assuming you pass the options directly (not trying to use the simplified httpPost() method) and specify the encoding of the request and the system will take care of it.
Much clearer! So if I send the body as a string it's up to me to encode it. If it is a map you guys handle it. Btw, for consistency sake, might make sense to update the docs for asynchttpPost to match since I'm assuming it does the same thing?