rest-assured/src/main/java/io/restassured/internal/http/HTTPBuilder.java
protected Object doRequest(URI uri, String method, Object contentType, boolean hasBody, Closure configClosure) throws IOException {
        HttpRequestBase reqMethod = HttpRequestFactory.createHttpRequest(uri, method, hasBody);
        RequestConfigDelegate delegate = new RequestConfigDelegate(reqMethod, contentType,
                this.defaultRequestHeaders,
                this.defaultResponseHandlers);
        configClosure.setDelegate(delegate);
        configClosure.setResolveStrategy(Closure.DELEGATE_FIRST);
        configClosure.call(reqMethod);

        return this.doRequest(delegate);
    }
protected Object doRequest(URI uri, String method, Object contentType, boolean hasBody, Closure configClosure) throws IOException {
        HttpRequestBase reqMethod = HttpRequestFactory.createHttpRequest(uri, method, hasBody);
        RequestConfigDelegate delegate = new RequestConfigDelegate(reqMethod, contentType,
                this.defaultRequestHeaders,
                this.defaultResponseHandlers);
        configClosure.setDelegate(delegate);
        configClosure.setResolveStrategy(Closure.DELEGATE_FIRST);
        configClosure.call(reqMethod);

        return this.doRequest(delegate);
    }
Create a {@link RequestConfigDelegate} from the given arguments, execute the
config closure, then pass the delegate to {@link #doRequest(RequestConfigDelegate)},
which actually executes the request.