sergiosorias / jscep

Automatically exported from code.google.com/p/jscep
MIT License
0 stars 0 forks source link

Decouple Transport from Request #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by da...@grant.org.uk on 29 Mar 2012 at 5:10