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: EthernetNetIf mbed
Diff: HTTPClientExample.cpp
- Revision:
- 0:b97bbcd81179
- Child:
- 1:4e6e885b48a2
diff -r 000000000000 -r b97bbcd81179 HTTPClientExample.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientExample.cpp Fri Jun 11 16:43:30 2010 +0000
@@ -0,0 +1,40 @@
+#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;
+
+}