public Request createPostRequest ( String url , Map < String , Object > params , String apiKey , String accessToken ) { FormBody . Builder builder = new FormBody . Builder ( ) ; for ( Map . Entry < String , Object > entry : params . entrySet ( ) ) { builder . add ( entry . getKey ( ) , entry . getValue ( ) . toString ( ) ) ; } RequestBody requestBody = builder . build ( ) ; Request request = new Request . Builder ( ) . url ( url ) . post ( requestBody ) . header ( "User-Agent" , USER_AGENT ) . header ( "X-Kite-Version" , "3" ) . header ( "Authorization" , "token " + apiKey + ":" + accessToken ) . build ( ) ; return request ; }
Creates a POST request .