Python

ThingsOn HTTP API / Python

Python programlama dilini kullanarak platforma veri göndermek için aşağıdaki örneği kullanabilirsiniz.

Write
import http.client
conn = http.client.HTTPConnection("cloud,thingson,io")
payload = "[TABLE_NAME] [FIELD_1=90],[FIELD_2=90],[FIELD_3=90]"
headers = {
'Authorization': "Basic [API_KEY]",
}
conn.request("POST", "write", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))