I am interested in using an ESP8266 to power a physical interface for a network connected device. The device itself supports REST commands, but I am not quite sure how to send PUT requests from the ESP8266. Right now, I am able to use the device's web debugging interface to send REST commands, but I am not sure how I would translate that to the ESP8266.
Using a web browser, I am able to GET information by browsing to
<DEVICE_IP>/API/<USER_ID>/<RESOURCE>
but I can only get the current state of that resource by navigating to that URL. How would I send a PUT request?
Best Answer
After reading a short tutorial on the ESP8266 module using the Arduino API, I found that replacing the "GET" string with a "PUT" string with the command following. Specifically, to send the command
to the resource at
The ESP8266 would execute:
Honestly, I have very little idea why the "Host," "Content-Length," or "Content-Type" (or even "Connection") are there, but this isn't a MWE, just a WE.