#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "redmi";
const char* password = "00000000";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected!");
HTTPClient http;
http.begin("http://jsonplaceholder.typicode.com/posts/1"); // Sample API
int httpCode = http.GET(); // Send GET request
if (httpCode > 0) {
String payload = http.getString();
Serial.println(payload); // Print response
}
http.end();
}
void loop() {}