public < T > T makeRequest ( String call , String method , boolean authenticate , ApiRequestWriter writer , ApiResponseReader < T > reader ) { HttpURLConnection connection = null ; try { connection = sendRequest ( call , method , authenticate , writer ) ; handleResponseCode ( connection ) ; if ( reader != null ) return handleResponse ( connection , reader ) ; else return null ; } catch ( IOException e ) { throw new OsmConnectionException ( e ) ; } catch ( OAuthException e ) { // because it was the user's fault that he did not supply an oauth consumer and the // error is kinda related with the call he made throw new OsmAuthorizationException ( e ) ; } finally { if ( connection != null ) connection . disconnect ( ) ; } }
Make a request to the Http Osm Api