Logs
A great debugging resource is the ability to view the logs of your function. To do so, refer to the control bar and select the "logs" icon as shown below to view the history of your Function's executions:
In the Function's logs, you can confirm data was successfully posted to Ubidots with the 201 response code:
This is what your function returns. It must be in a JSON dictionary format. In your code, make sure to use return to quit the function and return the dictionary.
NodeJS
Python
1
return response.data;
Copied!
1
return {"status": "Ok", "result": req.json()}
Copied!
This is used to debug purposes, you can print any kind of variables defined before in it or to just print any message that needs to be displayed to the user.
NodeJS
Python
1
console.log("[INFO] Request result:");
2
console.log(response);
Copied!
1
print("[INFO] Request result:")
2
print(req.text)
Copied!
Copy link