Sending data from a cellular modem to webhook.site
Reference: webhook.site
This tutorials is created for the u-blox R412 modem
-
Set up the base url using
+UHTTP
:AT+UHTTP=0,1,"webhook.site"
-
Set custom header(s) (optional):
AT+UHTTP=0,9,"1:Content-Type:application/json"
-
Create JSON file:
sensordata.json
AT+UDWNFILE="sensordata.json",19 > {"temperature": 21}
-
Read file:
AT+URDFILE="sensordata.json"
-
Send data:
AT+UHTTPC=0,4,"<webhook.site path>","data.txt","sensordata.json",4
-
Read server response:
AT+URDFILE="data.txt"
-
Delete
sensordata.json
(optional)AT+UDELFILE="sensordata.json"
-
Visit webhook.site to see you message appear: