Esp8266 post api

Hello guys I wish to use ESP8266 TO MAKE REQUESTS to an API, I don't how to go about it using the board.

Below are working examples using other languages, someone please help.

var url = " https://tinypesa.com/api/v1/express/initialize";

fetch(url, {
body: "amount=50&msisdn=0700034834&account_no=200",
headers: {
Apikey: "erwyuweoyf",
"Content-Type": "application/x-www-form-urlencoded",
},
method: "POST",
});

----------------------------------------------+------
curl -X POST
https://tinypesa.com/api/v1/express/initialize
-H "Content-Type: application/x-www-form-urlencoded"
-H "ApiKey: erwyuweoyf"
-d 'amount=50&msisdn=0700034834&account_no=200'

File -> Examples -> ESP8266HTTPClient -> PostHttpClient

For me the problem is getting the above information into the Arduino code, if anyone assisted me I would be so happy.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.