HTTP/2 support in <cfhttp>

I was wondering if there is any plan to support HTTP/2 in in the future? Currently I need HTTP/2 support to interact with some of Apple’s services.

I am currently using java.net.http.HttpClient as a workaround which support HTTP/2 on Java 21

Gemini AI’s review of the HTTP code in Lucee

1. Underlying Implementation in Http.java

The core class implementing the <cfhttp> tag is core/src/main/java/lucee/runtime/tag/Http.java .

Looking at the imports (lines 52–83):

java

import org.apache.http.HttpEntityEnclosingRequest;

import org.apache.http.HttpHost;

import org.apache.http.HttpResponse;

import org.apache.http.client.methods.HttpPost;

import org.apache.http.impl.client.CloseableHttpClient;

import org.apache.http.impl.client.HttpClientBuilder;

import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;

import lucee.commons.net.http.httpclient.HTTPEngine4Impl;

<cfhttp> is built entirely on top of Apache HttpComponents HttpClient 4.5.x (org.apache.http.*) via Lucee’s wrapper class HTTPEngine4Impl.java .


2. Apache HttpClient 4.5.x Limitations

  • Apache HttpClient 4.x is strictly HTTP/1.1 and HTTP/1.0: It has no multiplexing framing, no HPACK header compression, and no ALPN (Application-Layer Protocol Negotiation) for HTTP/2.
  • Apache Added HTTP/2 only in HttpClient 5.x (org.apache.hc.client5.*), which has a completely different package namespace and API. Lucee has not upgraded <cfhttp> to HttpClient 5.x.
  • No Tag Attributes for Protocol Selection: Http.java has attributes for method, charset, timeout, proxy, useragent, etc., but contains no mechanism or attributes for protocol versioning or ALPN negotiation.