With Node-Red, I'm trying to set the right parameters for http request, but I'm not able to do it.
The query with curl is this:
curl -H "Content-Type: application/json" -X GET -d '{"auth_key":"xf79rra", "payload":null}' https://retepaiot.it/sensordata/0018b1213
and it works.
I think I've made somethings wrong passing auth_key and payload (they are not URL parameters). I use the function to prepare the message:
msg.headers = {
"Content-Type": "application/json"
};
msg.payload = {auth_key:"xf7xxxx9rra",
payload:null};
return msg;
and http request for URL:
https://retepaiot.it/sensordata/001xxxx1213
the returned message is:
{ "message": "Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)"}