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

Allow :body be java.net.http.HttpRequest$BodyPublisher instance #55

Closed
lotuc opened this issue Apr 23, 2024 · 0 comments
Closed

Allow :body be java.net.http.HttpRequest$BodyPublisher instance #55

lotuc opened this issue Apr 23, 2024 · 0 comments

Comments

@lotuc
Copy link
Contributor

lotuc commented Apr 23, 2024

Now :body is converted to java.net.http.HttpRequest$BodyPublisher which then be used to create the java.net.http.HttpRequest. The converter now does not support java.net.http.HttpRequest$BodyPublisher directly.

HttpClient use BodyPublisher's contentLength as the request header's content-length. And notice that directly setting content-length is restricted somehow. This is the scenario when I encountered the problem (when use stream as body, the request's content-length could not be set; the stream is a wrapped one which we know the exactly size).

lotuc added a commit to lotuc/http-client that referenced this issue Apr 23, 2024
lotuc added a commit to lotuc/http-client that referenced this issue Apr 23, 2024
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