HTTP POST from Arduino/ESP8266/ESP32 How to send parameters (x-www-form-urlencoded)
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");