ESP8266 - Send HTTP requests to IP address?

Hello Arduino forum,

I'm working on a project that requires an ESP8266 to send data to another IP address connected to the same router via HTTP. I can send this data straight-forward by browser URL, and want the ESP to perform the same function.

EG: I can type "http://192.168.1.123/set?code=1234" into a browser from another client connected to the same router, but want the ESP to do the same.

Do you know of any examples where this is accomplished, or can you please provide a simple code rundown of how to do it?

Thanks,

(deleted)

I'm sure that those examples probably do work, my code however does not.

String URL = "http://192.168.1.123";
int Port = 80;

WiFiClient client;
client.connect(URL, Port);
client.println("POST /set?code=1234");

post a full compileable sketch only!

from the 3 lines you provided I suspect the HTTP method POST vs GET, but show a compileable code and we might see more.

I can type "http://192.168.1.123/set?code=1234" into a browser

which is using 'GET' method