import okhttp3.OkHttpClient;import okhttp3.FormBody;import okhttp3.Request;import okhttp3.RequestBody;// HashMap with ParamsHashMapparams = new HashMap<>();params.put( "Param1", "A" );params.put( "Param2", "B" );// Initialize Builder (not RequestBody)FormBody.Builder builder = new FormBody.Builder();// Add Params to Builderfor ( Map.Entry entry : params.entrySet() ) { builder.add( entry.getKey(), entry.getValue() );}// Create RequestBodyRequestBody formBody = builder.build();// Create Request (same)Request request = new Request.Builder() .url( "url" ) .post( formBody ) .build();