carrascoacd / ArduinoSIM800L

Arduino HTTP & FTP client for SIM800L/SIM800 boards to perform GET and POST requests to a JSON API as well as FTP uploads.
159 stars 58 forks source link

Variable in payload #14

Closed MateuszManaj closed 5 years ago

MateuszManaj commented 5 years ago

Hi there, How to add (in proper way) a variable (concat) to this json payload ? Result result = http.post("your.api.com", "{\"date\":\"12345678\"}", response);

thank you in advance Matthew

carrascoacd commented 5 years ago

Just check this example: https://github.com/carrascoacd/ArduinoSIM800L/blob/master/HttpExample/HttpExample.ino#L53

It is based on sprintf https://www.tutorialspoint.com/c_standard_library/c_function_sprintf.htm