void get_request_http(){
String URL= "//noi dung URL cac em tu tao theo dung cu phap cua trang web va theo
cac thong so ma ca em muon//"
Serial.println("Ok! ESP8266 perform http request");
// Initialize the client library
WiFiClient client; // Creates a client that can connect to to a specified
internet IP address and port as defined in client.connect()
HTTPClient http; //Declare an object of class HTTPClient
http.begin(URL);
// Your IP address with path or Domain name with URL path: http.begin(client,
serverName); // (Mot so version of ESP8266 can su dung lop client trong http.begin)
int http_respond_code=http.GET();
String Stringcode="{}";
if (http_respond_code >0){ // check the return code from OpenWeather
Serial.println(URL);
Serial.println("http_respond_code:");
Serial.println(http_respond_code);
Stringcode=http.getString();
Serial.println(Stringcode);
}
else {
Serial.println("Error Code");
Serial.println(http_respond_code);
}
http.end(); //Close connection
}
}