Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MbedJSONValue mbed-http HTS221
Diff: source/main-http.cpp
- Revision:
- 38:7734b54de565
- Parent:
- 37:e809fd407dc9
- Child:
- 39:9856f09a1333
diff -r e809fd407dc9 -r 7734b54de565 source/main-http.cpp
--- a/source/main-http.cpp Mon Oct 21 11:56:25 2019 +0000
+++ b/source/main-http.cpp Sat Dec 28 07:53:23 2019 +0000
@@ -10,9 +10,9 @@
static DevI2C devI2c(PB_11,PB_10);
static HTS221Sensor hum_temp(&devI2c);
-//theKsystemsURL = "https://api.theksystem.com/update?apiKey=9Q8vOz1lguaV6Ou4&field1=21"
+
char* thingspark_URL = "http://api.thingspark.kr";
-char* thingspark_APIkey = "hKqQALm22Hd79N6I";
+char* thingspark_APIkey = "1yUxh3Dh77DUQyOt";
char urlBuffer[256];
void dump_response(HttpResponse* res) {
@@ -84,26 +84,7 @@
printf("\nUpdate count %d (Every 30sec, data update to thingspark server)\n",updateCnt++);
wait(30);
}
-#if 0
- // POST request to httpbin.org
- {
- HttpRequest* post_req = new HttpRequest(network, HTTP_POST, "http://httpbin.org/post");
- post_req->set_header("Content-Type", "application/json");
- const char body[] = "{\"hello\":\"world\"}";
-
- HttpResponse* post_res = post_req->send(body, strlen(body));
- if (!post_res) {
- printf("HttpRequest failed (error code %d)\n", post_req->get_error());
- return 1;
- }
-
- printf("\n----- HTTP POST response -----\n");
- dump_response(post_res);
-
- delete post_req;
- }
-#endif
wait(osWaitForever);
}