Welcome! Please see the About page for a little more info on how this works.

+3 votes
ago in Java Interop by
edited ago by

Java 9 introduced java.net.http.HttpClient[1] with support for HTTP/1.1, HTTP/2 as well as WebSocket along with other features. It was later standardized in Java 11[2] and has become one of the top picks for Java programs. The latest version of the HTTP client shipped with Java 26 also added support for HTTP/3.[3]

It would be nice for future versions of Clojure that are based on Java 11+ to include a new namespace with wrapper functions around java.net.http.HttpClient to make it easier (without all the OOP ceremonies) to work with HTTP in Clojure programs out of the box without relying on any 3rd-party libraries.

Examples of prior art:

[1] https://openjdk.org/jeps/110
[2] https://openjdk.org/jeps/321
[3] https://openjdk.org/jeps/517

ago by
Here are a few more libraries that are light wrappers over the jdk HttpClient. Notably they expose a way to send a response body handler with the request, as HttpClient does.

https://github.com/exoscale/telex
https://github.com/onionpancakes/hop

Please log in or register to answer this question.

...