send data to Xtension from Arduino
James Sentman
james at sentman.com
Sun Jul 30 08:59:40 EDT 2017
Yes, what Tom said :)
you just need to send a proper HTML header. There are tons of arduino examples for doing this out there as it’s a common way to handle it, but you basically just need to format it as:
GET /token/address/on HTTP/1.1\r\n\r\n
the “host” and “connection: closed” headers are fine to send as well before the blank line that ends the headers, but for XTEnsion those are pretty much ignored anyway. There is no virtual hosting so the Host line isn’t important and every connection to the JSON server is closed after it’s handled and no keep-alive connections are allowed at the moment. I might support that in the future as I’ve just written a bunch of code to support real html 1.1 protocols in the plugin system but even so just closing the connection after sending your request will always be good enough.
> On Jul 29, 2017, at 4:38 PM, Bill Brandt <wnbrandt at me.com> wrote:
>
> Thanks, I think this gave me the missing parts I needed. Still working my way through but at least now moving forward again.
>
>
> // This will send the request to the server
> client.print(String("GET ") + url + " HTTP/1.1\r\n" +
> "Host: " + host + "\r\n" +
> "Connection: close\r\n\r\n");
>
Thanks,
James
James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20170730/e65e7013/attachment.html>
More information about the XTensionList
mailing list