Use java.net.http.HttpClient instead of legacy java.net.Http(s)URLConnection #67

Closed
opened 2025-12-30 01:20:21 +01:00 by adam · 1 comment
Owner

Originally created by @odenix on GitHub (Feb 14, 2024).

Moving to java.net.http.HttpClient brings many benefits, including:

  • HTTP/2 support
  • optional async mode
  • no need to set a system-wide default SSLSocketFactory

Instead of directly interfacing with java.net.http.HttpClient, I'd recommend to introduce a lightweight org.pkl.core.http.HttpClient facade. This keeps some flexibility and allows to enforce things like setting User-Agent.

If this sounds good, I'll work on a draft PR.

Originally created by @odenix on GitHub (Feb 14, 2024). Moving to `java.net.http.HttpClient` brings many benefits, including: * HTTP/2 support * optional async mode * no need to set a system-wide default `SSLSocketFactory` Instead of directly interfacing with `java.net.http.HttpClient`, I'd recommend to introduce a lightweight `org.pkl.core.http.HttpClient` facade. This keeps some flexibility and allows to enforce things like setting `User-Agent`. If this sounds good, I'll work on a draft PR.
adam closed this issue 2025-12-30 01:20:21 +01:00
Author
Owner

@bioball commented on GitHub (Feb 14, 2024):

Hi, this sounds good! Go ahead and submit a PR for this.

@bioball commented on GitHub (Feb 14, 2024): Hi, this sounds good! Go ahead and submit a PR for this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#67