Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Joshua Perk
#56614 Hi, all!

I've looked through the many included examples that come with Core and I'm fairly certain I'm over complicating things. My ESP8266 automatically connects to my WiFi without issue. Now, all I want it to do is send one command.

Background:

I have hosted a PHP script that when ran with an API key will change a field in a database from 0 to 1. It is structured like http://website.com/api/index.php?key=123456789

How can I tell my ESP8266 to "go" to that URL? I don't care about any return or receiving of data, I just want to run that script with the key.

Thank you!
User avatar
By Joshua Perk
#56665 I want to reply to my own post with a link I found moments after submitting this topic. Adafruit did a really good job of writing a tutorial on this simple post here:https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide.

In particular, here's the main snippet I was going for:

Code: Select all  // 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");