marcoschwartz / aREST

A RESTful environment for Arduino
http://aREST.io/
Other
1.2k stars 279 forks source link

sending aREST call via HTTP.POST inside Arduino sketch #272

Closed OmiD-K closed 3 years ago

OmiD-K commented 4 years ago

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

marcoschwartz commented 3 years ago

Hello, we are currently working on POST requests for the aREST API, closing this for now as it is referenced in other issues.