
Dependencies: EthernetNetIf mbed
HTTPClientExample.cpp
- Committer:
- donatien
- Date:
- 2010-06-11
- Revision:
- 0:b97bbcd81179
- Child:
- 1:4e6e885b48a2
File content as of revision 0:b97bbcd81179:
#include "mbed.h" #include "EthernetNetIf.h" #include "HTTPClient.h" EthernetNetIf eth; HTTPClient http; int main() { printf("Start\n"); printf("\r\nSetting up...\r\n"); EthernetErr ethErr = eth.setup(); if(ethErr) { printf("Error %d in setup.\n", ethErr); return -1; } printf("\r\nSetup OK\r\n"); HTTPText txt; HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt); if(r==HTTP_OK) { printf("Result :\"%s\"\n", txt.gets()); } else { printf("Error %d\n", r); } while(1) { } return 0; }