w5200NetIf/main.cpp

#include "WIZ820ioNetIf.h"
#include "HTTPClient.h"
#include "HTTPServer.h"

WIZ820ioNetIf eth;
HTTPServer svr;
HTTPClient http;
HTTPStream stream;

void callback(HTTPResult r){printf("callback(%d)\n",r);}

int main() {
    eth.setup();
    svr.addHandler<SimpleHandler>("/");
    svr.bind(80);
    http.get("http://mbed.org/feeds/activity/", &stream, callback);
    byte buf[256];
    stream.readNext(buf, sizeof(buf));
    while(1) {
        if(stream.readable()) {
            printf("%d\n", stream.readLen());
            stream.readNext(buf, sizeof(buf));
        }
        Net::poll();
    }
}