-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Added a way to define a body in ReactiveStreamBodies #1137
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
Added a way to define a body in ReactiveStreamBodies #1137
Conversation
@jroper Thought? |
I think this makes sense, though it'd be good to see javadoc on |
Agree, but on
Actually, those were only used by the Grizzly and the JDK provider in 1.9. I missed that I should remove them in AHC2. Thanks! |
Shoot, I didn't realize this PR was indeed introducing a request.getContentLength usage. Let's then discuss how to bring a Content-Length there. It should be the Body's responsibility. |
Wouldn't my take won't be good enough? Or how do you mean "it should be the Body's responsibility". I mean it's a streamed response, but maybe the user already know the Content-Length and wants to set it btw. we could discuss in the issue I've created #1136 and I try my best to do it. The last night I just wanted a quick demo so i was very sleepy when I did it. Edit: Oh I see you actually removed the method. Another way of doing that would actually be using the Header and extracting it. As said the Content-Length should be set manually. Use case would be using the Streaming interface to upload multipart/form-data via a Publisher where the other endpoint only supports Http 1.0 |
No. As of #1138, I just remove
Don't get me wrong, I agree with the feature (being able to set the Content-Length). It would be confusing to have such methods in the Generic API that are only used from for ReactiveStreams. |
@slandelle see my edit, what about: Changing this part to check if there is a existing Header? i.e. either TRANSFER_ENCODING or CONTENT_LENGTH and keep it if it's there ? |
That looks like a very complicated way to me. IMO, the proper solution would be to overload |
That would be fine to me too however that would mean we would need to change play-ws while the Header change wouldn't need a change. I open a new PR with your solution. |
Well, from my pov, that's a new feature. :) |
#1139 opened, suggestions are welcomed so that I could fix it when I'm done with work. ;) |
Actually this would be a approach for #1136