HTTP POST from Arduino/ESP8266/ESP32 How to send parameters (x-www-form-urlencoded) EDIT: Thank you for the answer, also we had figured out how to do it Micropython too - I believe that it is relevant for the Arduino/ESP8266/ESP32 community to share this too.

https://github.com/46elks/46elks-getting-started/blob/master/code-examples/MicroPython/https_post_with_micropython.py

How should I include parameters from, to and message to http.post?

Is this the correct way to do it?
http.POST("'from:+XXXXX','to:+XXXXX','message:Hej'");

#include &lt;M5StickC.h&gt;
#include &lt;Arduino.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;WiFiMulti.h&gt;

#include &lt;HTTPClient.h&gt;

#define USE_SERIAL Serial

WiFiMulti wifiMulti;

void setup() {

    USE_SERIAL.begin(115200);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    for(uint8_t t = 4; t &gt; 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    wifiMulti.addAP("YYYY", "ZZZZZ");

}

void loop() {
    // wait for WiFi connection
    if((wifiMulti.run() == WL_CONNECTED)) {

        HTTPClient http;

        USE_SERIAL.print("[HTTP] begin...\n");
        // configure traged server and url

          http.begin("https://api.46elks.com/a1/sms");
          http.addHeader("Content-Type", "application/x-www-form-urlencoded"); 
          http.setAuthorization("XXXXX", "YYYYYY");
          int httpCode = http.POST("'from:+XXXXX','to:+XXXXX','message:Hej'");

        USE_SERIAL.print("[HTTP] GET...\n");
        // start connection and send HTTP header
         httpCode = http.GET();

        // httpCode will be negative on error
        if(httpCode &gt; 0) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == HTTP_CODE_OK) {
                String payload = http.getString();
                USE_SERIAL.println(payload);
            }
        } else {
            USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
        }

        http.end();
    }

    delay(10000);
}
What format of message does the server expect? As you send "x-www-form-urlencoded" it should probably look like:

 "from=+XXXXX&amp;to=+XXXXX&amp;message=Hej"


where the different parts are

 "param1=paramValue1&amp;param2=paramValue2&amp;param3=paramValue3"

 param .... Name of the expected parameter
 = .... divides the param pair
 paramValue .... Content/value of the parameter
 &amp; .... links the param pairs


so in your case

 int httpCode = http.POST("from=+XXXXX&amp;to=+XXXXX&amp;message=Hej");