private static HttpResponse doCall(ArmeriaCallFactory callFactory, Request request) {
            final HttpUrl httpUrl = request.url();
            final WebClient webClient = callFactory.getWebClient(httpUrl);
            final String absolutePathRef;
            if (httpUrl.encodedQuery() == null) {
                absolutePathRef = httpUrl.encodedPath();
            } else {
                absolutePathRef = httpUrl.encodedPath() + '?' + httpUrl.encodedQuery();
            }

            final RequestHeadersBuilder headers = RequestHeaders.builder(HttpMethod.valueOf(request.method()),
                                                                         absolutePathRef);
            final Headers requestHeaders = request.headers();
            final int numHeaders = requestHeaders.size();
            for (int i = 0; i < numHeaders; i++) {
                headers.add(HttpHeaderNames.of(requestHeaders.name(i)),
                            requestHeaders.value(i));
            }

            final RequestBody body = request.body();
            final Invocation invocation = request.tag(Invocation.class);
            if (body == null) {
                // Without a body.
                try (SafeCloseable ignored = withContextCustomizer(
                        ctx -> InvocationUtil.setInvocation(ctx, invocation))) {
                    return webClient.execute(headers.build());
                }
            }

            // With a body.
            final MediaType contentType = body.contentType();
            if (contentType != null) {
                headers.set(HttpHeaderNames.CONTENT_TYPE, contentType.toString());
            }

            try (Buffer contentBuffer = new Buffer()) {
                body.writeTo(contentBuffer);

                try (SafeCloseable ignored = withContextCustomizer(
                        ctx -> InvocationUtil.setInvocation(ctx, invocation))) {
                    return webClient.execute(headers.build(), contentBuffer.readByteArray());
                }
            } catch (IOException e) {
                throw new IllegalArgumentException(
                        "Failed to convert RequestBody to HttpData. " + request.method(), e);
            }
        }
A {@link Factory} that creates a {@link Call} instance for {@link WebClient}.
retrofit2/src/main/java/com/linecorp/armeria/client/retrofit2/ArmeriaCallFactory.java