public void get ( final String path , final HttpResponseCallback callback ) { if ( path == null ) { postCallbackOnMainThread ( callback , new IllegalArgumentException ( "Path cannot be null" ) ) ; return ; } final String url ; if ( path . startsWith ( "http" ) ) { url = path ; } else { url = mBaseUrl + path ; } mThreadPool . submit ( new Runnable ( ) { @ Override public void run ( ) { HttpURLConnection connection = null ; try { connection = init ( url ) ; connection . setRequestMethod ( METHOD_GET ) ; postCallbackOnMainThread ( callback , parseResponse ( connection ) ) ; } catch ( Exception e ) { postCallbackOnMainThread ( callback , e ) ; } finally { if ( connection != null ) { connection . disconnect ( ) ; } } } } ) ; }
Make a HTTP GET request to using the base url and path provided . If the path is a full url it will be used instead of the previously provided base url .