public Response executeToResponse ( HttpConnection connection ) { InputStream is = null ; try { is = this . executeToInputStream ( connection ) ; Response response = getResponse ( is , Response . class , getGson ( ) ) ; response . setStatusCode ( connection . getConnection ( ) . getResponseCode ( ) ) ; response . setReason ( connection . getConnection ( ) . getResponseMessage ( ) ) ; return response ; } catch ( IOException e ) { throw new CouchDbException ( "Error retrieving response code or message." , e ) ; } finally { close ( is ) ; } }
Executes a HTTP request and parses the JSON response into a Response instance .