You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, to use it with JSON, it is always required to create an adapter class that converts a JSON that comes in String/InputStream to a Java object.
Having standard BodyHandler and BodyPublisher could easy the work done in the client side to interact with the HttpClient API.
There are already some Colletors in the API to interact with streams in Java 8, so I guess adding BodyHandlers and BodyPublisher would be possible too.
I just don't know which spec would be better to include this, if Jakarta Json Processing or Jakarta Json Binding.
Since Java 11, there is the new HttpClient API.
However, to use it with JSON, it is always required to create an adapter class that converts a JSON that comes in String/InputStream to a Java object.
Having standard BodyHandler and BodyPublisher could easy the work done in the client side to interact with the HttpClient API.
There are already some Colletors in the API to interact with streams in Java 8, so I guess adding BodyHandlers and BodyPublisher would be possible too.
I just don't know which spec would be better to include this, if Jakarta Json Processing or Jakarta Json Binding.
Thoughts?
https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html
https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodyHandler.html
https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpRequest.BodyPublisher.html
The text was updated successfully, but these errors were encountered: