I try sending aREST call via HTTP.POST inside arduino sketch ,but it cant sent params.
I want send aREST Call from one esp to another esp .
pls help me How I can use that anyway.
Here is my sample code:
HTTPClient http; //Declare object of class HTTPClient
I try sending aREST call via HTTP.POST inside arduino sketch ,but it cant sent params. I want send aREST Call from one esp to another esp . pls help me How I can use that anyway. Here is my sample code:
HTTPClient http; //Declare object of class HTTPClient
http.begin("http://192.168.4.2:80/led"); //Specify request destination http.addHeader("Content-Type", "text/plain"); //Specify content-type header int httpCode = http.POST("params=command"); //Send the request. command is parameter String payload = http.getString(); //Get the response payload Serial.println(httpCode); //Print HTTP return code Serial.println(payload); //* Print request response payload http.end(); //Close connection
in this line int httpCode = http.POST("params=command"); //Send the request Im trying send parameter but not work.
with regards Omid