static HttpRequest of(RequestHeaders headers, Publisher<? extends HttpObject> publisher) {
        requireNonNull(headers, "headers");
        requireNonNull(publisher, "publisher");
        if (publisher instanceof HttpRequest) {
            return ((HttpRequest) publisher).withHeaders(headers);
        } else if (publisher instanceof StreamMessage) {
            return new StreamMessageBasedHttpRequest(headers, (StreamMessage<? extends HttpObject>) publisher);
        } else {
            return new PublisherBasedHttpRequest(headers, publisher);
        }
    }
Creates a new instance from an existing {@link RequestHeaders} and {@link Publisher}.

<p>Note that the {@link HttpObject}s in the {@link Publisher} are not released when
{@link Subscription#cancel()} or {@link #abort()} is called. You should add a hook in order to
release the elements. See {@link PublisherBasedStreamMessage} for more information.
core/src/main/java/com/linecorp/armeria/common/HttpRequest.java