pkl
pkl copied to clipboard
Use java.net.http.HttpClient instead of legacy java.net.Http(s)URLConnection
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.