I am currently using the HttpClient library to upload to a server some variables. I would like to stop using this library and try out the Particle webhooks instead, but I am new to webhooks and I am not familiar with their usage yet.
I have a Photon reading temperature, humidity, and WiFi strength. All three variables are currently being sent to the server via a GET request (i.e. www. myserver .com/update?t=77&h=40&w=-67), but I have the capability of not uploading any value which does not meet certain criteria (like if temperature is very low it does not get updated in the server, i.e. www. myserver .com/update?h=39?w=-48)
Based on the above description I would like to know the following:
- Can I change the query string of the webhook at runtime, based on the values read by the Photon?
- Is there a way to catch the response status code (“200”) from the webhook? I read that you could use hook-response to get the response body, but I wanted to know if there is a way of actually validating the response status code (200, 400, etc) inside my code.
Thank you all for your help!