Go Down

Topic: HTTP POST method help for Node MCU esp8266 (Read 153 times) previous topic - next topic

rak112

Hi all,

Please help me with the Integration of Node Mcu for POST request

I have a userId and Password grant type method for OAuth 2.0,

and with URL parameters

like: https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=-----------&client_secret=--------&username=rak@---.com&password=------

I getting Response from "Postman" but am new to Arduino coding

I have used this process for POST method but it  is not working fine



 HTTPClient http;
 String str="url for POST req like above mentioned";
  Serial.print("str "+str);
  http.begin(str);
 int httpCode = http.POST("");
 if(httpCode > 0) {
    if(httpCode == HTTP_CODE_OK) {
      String payload = http.getString();
      Serial.print("payload "+payload);
    }
  } else {
  }
  http.end();



Thanks in Advance !!!





Go Up