Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: main.cpp
- Revision:
- 3:32834ef7cb56
- Parent:
- 0:ed4d6fd405ea
- Child:
- 4:363b4cc49445
--- a/main.cpp Thu Jan 30 11:11:50 2014 +0000 +++ b/main.cpp Thu Jan 30 11:47:29 2014 +0000 @@ -14,16 +14,23 @@ HTTPClient http; char str[512]; - int ret = modem.connect("internet"); // eventaully set another apn here + int ret = modem.connect("public4.m2minternet.com"); // eventaully set another apn here if(ret) { printf("Could not connect %d\n", ret); return; } + http.basicAuth("vaillant/admin", "klanpi"); + + char *hkey = "X-Id";char *hval = "com_test_device"; + char *harr[] = {hkey, hval}; + + http.customHeaders(harr, 1); + //GET data printf("Trying to fetch page...\n"); - ret = http.get("http://mbed.org/media/uploads/donatien/hello.txt", str, 128); + ret = http.get("http://nocore.info:8888", str, 128); if (!ret) { printf("Page fetched successfully - read %d characters\n", strlen(str)); printf("Result: %s\n", str); @@ -37,7 +44,7 @@ map.put("Hello", "World"); map.put("test", "1234"); printf("Trying to post data...\n"); - ret = http.post("http://httpbin.org/post", map, &text); + ret = http.post("http://nocore.info:8888", map, &text); if (!ret) { printf("Executed POST successfully - read %d characters\n", strlen(str)); printf("Result: %s\n", str);