Skip to content
Snippets Groups Projects
Commit 6767d33b authored by CARNEIRO--GILLET Alexandre's avatar CARNEIRO--GILLET Alexandre
Browse files

creation test_envoi_senscom, template fonctionnel

parent 11b011ff
Branches
No related tags found
No related merge requests found
import json
import requests
url = "https://api.sensor.community/v1/push-sensor-data/"
headers = {
"Content-Type": "application/json",
"X-Pin": "1",
"X-Sensor": "esp8266-12345678"
}
data = {
"software_version": "your_version",
"sensordatavalues": [
{"value_type": "P1", "value": "66.04"},
{"value_type": "P2", "value": "53.32"}
]
}
response = requests.post(url, headers=headers, data=json.dumps(data), timeout=10)
print(response.status_code)
print(response.text)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment