pkl icon indicating copy to clipboard operation
pkl copied to clipboard

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

Open translatenix opened this issue 4 months ago • 1 comments

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.

translatenix avatar Feb 14 '24 21:02 translatenix