Change the handling of the received data on HTTPRequest and
HTTPClientResponse to use the InputStream interface instead of
dataReceived and dataEnd handlers.
We should probably do something to make the following serer side and
client side patterns simpler:
void handler(HTTPRequest request, HTTPResponse response) {
...
StringBuffer body = new StringBuffer();
StringInputStream input = new StringInputStream(request.inputStream);
input.dataHandler = () => body.add(input.read());
input.closeHandler = () {
String data = body.toString();
...
}
}
HTTPClientConnection conn = ...
conn.responseHandler = (HTTPClientResponse r) {
...
StringBuffer body = new StringBuffer();
StringInputStream input = new StringInputStream(request.inputStream);
input.dataHandler = () => body.add(input.read());
input.closeHandler = () {
String data = body.toString();
...
}
}
R=ager@google.com,ajohnsen@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9495007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4679 260f80e4-7a28-3924-810f-c04153c831b5