Transport.sendRequest should be decoupled from Request. Different methods are
called on Request depending on the transport type (write for POST, getMessage
for GET) which is a bit ugly.
Perhaps a String operation parameter and OutputStream would suffice? The
response could be an object composed of an InputStream and the Content-Type,
but then we have to consider the closure of the InputStream. The could be
solved with an asynchronous callback, that is, by closing it after the callback
had been made, using the familiar pattern e.g.
try {
listener.onResponse(contentType, input);
} catch (IOException) {
...
} finally {
...
input.close();
...
}
Original issue reported on code.google.com by da...@grant.org.uk on 25 Aug 2011 at 7:39
Original issue reported on code.google.com by
da...@grant.org.uk
on 25 Aug 2011 at 7:39