public String getCSVRequest ( String url , String apiKey , String accessToken ) throws IOException , KiteException , JSONException { Request request = new Request . Builder ( ) . url ( url ) . header ( "User-Agent" , USER_AGENT ) . header ( "X-Kite-Version" , "3" ) . header ( "Authorization" , "token " + apiKey + ":" + accessToken ) . build ( ) ; Response response = client . newCall ( request ) . execute ( ) ; String body = response . body ( ) . string ( ) ; return new KiteResponseHandler ( ) . handle ( response , body , "csv" ) ; }
Makes GET request to fetch CSV dump .