protected Request.Builder setBody(Request.Builder builder) {
        if (body != null) {
            RequestBody requestBody = null;
            if (requestBody == null) {
                FormBody.Builder fbBuilder = new FormBody.Builder();
                Iterator<String> itr = body.keySet().iterator();
                while (itr.hasNext()) {
                    String key = itr.next();
                    fbBuilder.add(key, (String) body.get(key));
                }
                requestBody = fbBuilder.build();
            }

            if ("PUT".equalsIgnoreCase(method))
                builder.put(requestBody);
            else if ("POST".equalsIgnoreCase(method))
                builder.post(requestBody);
        }
        return builder;
    }
protected Request . Builder setBody ( Request . Builder builder ) { if ( body != null ) { RequestBody requestBody = null ; if ( requestBody == null ) { FormBody . Builder fbBuilder = new FormBody . Builder ( ) ; Iterator < String > itr = body . keySet ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { String key = itr . next ( ) ; fbBuilder . add ( key , ( String ) body . get ( key ) ) ; } requestBody = fbBuilder . build ( ) ; } if ( "PUT" . equalsIgnoreCase ( method ) ) builder . put ( requestBody ) ; else if ( "POST" . equalsIgnoreCase ( method ) ) builder . post ( requestBody ) ; } return builder ; }
set request body