public JSONObject asJson ( ) throws HelloSignException { JSONObject json = null ; String response = getLastResponse ( ) ; logger . debug ( "Response body: " + response ) ; try { json = new JSONObject ( response ) ; validate ( json ) ; } catch ( HelloSignException e ) { throw e ; } catch ( JSONException e ) { throw new HelloSignException ( e ) ; } finally { reset ( ) ; } return json ; }
Executes the request and returns the response as a JSONObject .