f
Fork of lwip by
examples/HTTPClient/main.cpp@1:803fdc96fbd7, 2017-08-03 (annotated)
- Committer:
- idijoeteque
- Date:
- Thu Aug 03 10:24:16 2017 +0000
- Revision:
- 1:803fdc96fbd7
- Parent:
- 0:5e1631496985
hello
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
root@mbed.org | 0:5e1631496985 | 1 | #include "mbed.h" |
root@mbed.org | 0:5e1631496985 | 2 | #include "HTTPClient.h" |
root@mbed.org | 0:5e1631496985 | 3 | |
root@mbed.org | 0:5e1631496985 | 4 | using namespace std; |
root@mbed.org | 0:5e1631496985 | 5 | |
root@mbed.org | 0:5e1631496985 | 6 | DigitalOut led(LED1); |
root@mbed.org | 0:5e1631496985 | 7 | HTTPClient http; |
root@mbed.org | 0:5e1631496985 | 8 | |
root@mbed.org | 0:5e1631496985 | 9 | const char user[] = "<username>"; |
root@mbed.org | 0:5e1631496985 | 10 | const char pass[] = "<password>"; |
root@mbed.org | 0:5e1631496985 | 11 | const char msg[] = "status=<message>"; |
root@mbed.org | 0:5e1631496985 | 12 | const char url[] = "http://twitter.com/statuses/update.xml"; |
root@mbed.org | 0:5e1631496985 | 13 | |
root@mbed.org | 0:5e1631496985 | 14 | int main(void) { |
root@mbed.org | 0:5e1631496985 | 15 | http.auth(user, pass); |
root@mbed.org | 0:5e1631496985 | 16 | http.post(url, msg); |
root@mbed.org | 0:5e1631496985 | 17 | |
root@mbed.org | 0:5e1631496985 | 18 | while(1) { |
root@mbed.org | 0:5e1631496985 | 19 | led = !led; |
root@mbed.org | 0:5e1631496985 | 20 | wait(0.2); |
root@mbed.org | 0:5e1631496985 | 21 | } |
root@mbed.org | 0:5e1631496985 | 22 | } |
root@mbed.org | 0:5e1631496985 | 23 |