Last active
June 11, 2020 14:28
-
-
Save jtuttas/c37c03d91f38b13d901e7914a7fa9dfd to your computer and use it in GitHub Desktop.
Daten in die adafruit Cloud eintragen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --header "Content-Type: application/json" --header "x-aio-key: aio_dUnx007cL54aZqVs9jemddNy6hVj" --data "{\"value\":18}" https://io.adafruit.com/api/v2/jtuttas/feeds/fiae19/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var settings = { | |
"async": true, | |
"crossDomain": true, | |
"url": "https://io.adafruit.com/api/v2/jtuttas/feeds/esp32/data", | |
"method": "POST", | |
"headers": { | |
"content-type": "application/json", | |
"x-aio-key": "geheim", | |
"cache-control": "no-cache" | |
}, | |
"processData": false, | |
"data": "{\n\t\"value\":18.5\n}" | |
} | |
$.ajax(settings).done(function (response) { | |
console.log(response); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.client | |
conn = http.client.HTTPSConnection("io.adafruit.com") | |
payload = "{\n\t\"value\":18.5\n}" | |
headers = { | |
'content-type': "application/json", | |
'x-aio-key': "geheim", | |
'cache-control': "no-cache" | |
} | |
conn.request("POST", "/api/v2/jtuttas/feeds/esp32/data", payload, headers) | |
res = conn.getresponse() | |
data = res.read() | |
print(data.decode("utf-8")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$request = new HttpRequest(); | |
$request->setUrl('https://io.adafruit.com/api/v2/jtuttas/feeds/esp32/data'); | |
$request->setMethod(HTTP_METH_POST); | |
$request->setHeaders(array( | |
'cache-control' => 'no-cache', | |
'x-aio-key' => 'geheim', | |
'content-type' => 'application/json' | |
)); | |
$request->setBody('{ | |
"value":18.5 | |
}'); | |
try { | |
$response = $request->send(); | |
echo $response->getBody(); | |
} catch (HttpException $ex) { | |
echo $ex; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget --quiet \ | |
--method POST \ | |
--header 'content-type: application/json' \ | |
--header 'x-aio-key: geheim' \ | |
--header 'cache-control: no-cache' \ | |
--body-data '{\n "value":18.5\n}' \ | |
--output-document \ | |
- https://io.adafruit.com/api/v2/jtuttas/feeds/esp32/data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment