Browse Source

new API

master
parent
commit
050961af68
2 changed files with 9 additions and 1 deletions
  1. +8
    -0
      Readme.md
  2. +1
    -1
      thingSpeak.cpp

+ 8
- 0
Readme.md View File

@ -0,0 +1,8 @@
# How to use it
This example pushes the measured data using HTTP POST request on ThinkSpeak server.
Thus, modify the APIKey in `thingSpeak.cpp`, then compile using:
```bash
g++ thingSpeak.cpp network/SocketClient.cpp - o thingSpeak
./thingSpeak
```

+ 1
- 1
thingSpeak.cpp View File

@ -33,7 +33,7 @@ int main() {
head << "POST /update HTTP/1.1\n"
<< "Host: api.thingspeak.com\n"
<< "Connection: close\n"
<< "X-THINGSPEAKAPIKEY: Z7PNWRYKDEBRX5F7\n"
<< "X-THINGSPEAKAPIKEY: 621LKPK58GD7PHSB\n"
<< "Content-Type: application/x-www-form-urlencoded\n"
<< "Content-Length:" << string(data.str()).length() << "\n\n";
sc.send(string(head.str()));


Loading…
Cancel
Save