Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a standard BodyHandler and BodyPublisher #300

Open
Thihup opened this issue Aug 20, 2021 · 0 comments
Open

Add a standard BodyHandler and BodyPublisher #300

Thihup opened this issue Aug 20, 2021 · 0 comments

Comments

@Thihup
Copy link

Thihup commented Aug 20, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant