I've built a basic web platform that will log data through HTTP GET requests anytime the following URL is hit: http://desolate-spire-6651.herokuapp.com/temperature_reading/save?temperature=70.5 My original goal was to do this with a Twine, but unfortunately it's currently broken.
In the meantime, I'd like to know how to send temperature data with a Raspberry Pi to my web platform through an HTTP GET request. Please note that I do not want to store or log the data on the Pi, I simply want the PI to send data to my web platform. Any suggestions?
-
While this isn't off-topic (as it is regarding the data being set from a Pi) this might get more attention and better answers on Stack Overflow, which is a Programming-centered Stack Exchange. You can keep this question here, but I think it might be better on Stack Overflow.RPiAwesomeness– RPiAwesomeness2014年02月27日 14:11:24 +00:00Commented Feb 27, 2014 at 14:11
2 Answers 2
wget
or curl
will do what you want. e.g.
temperature="70.5"
wget http://desolate-spire-6651.herokuapp.com/temperature_reading/save?temperature=${temperature}
This would also be pretty simple to do in Python, especially if you are already reading the temperature in a Python program. The Python "requests" module is perfect for this; a short quick tutorial is available at:
https://www.geeksforgeeks.org/get-post-requests-using-python/
Or thousands of other places, as a web search will show.