playframework / playframework/playframework
Incorrect Play 2.5.x JavaWS documentation page
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 12.6k
- Forks
- 4k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 29
Description
The following section of the documentation states that the WS client does not support streaming upload:
https://www.playframework.com/documentation/2.5.x/JavaWS#Accessing-AsyncHttpClient
It's not very clear from just the link to FeedableBodyGenerator how exactly we are supposed to solve this problem, but more importantly the WS client does in fact support streaming uploads! Depending on which method signatures you are looking at it may not look like it, and checking the documentation will confirm that incorrect assumption. Suppose you have a bytestring source and you want to POST it somewhere.
ws
.url("http://foo")
.post(/* many things are allowed here, but nothing that helps */);
The overloads for the post and similar methods on WSRequest don't support streaming, however it is supported just fine with setBody:
ws
.url("http://foo")
.setBody(mySource)
.execute("POST");
Where mySource is an instance of akka.stream.javadsl.Source<ByteString, ?>.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JavaWS documentation section at https://www.playframework.com/documentation/2.5.x/JavaWS#Accessing-AsyncHttpClient and verify the current statement about streaming uploads. Update the section to explain the setBody(mySource).execute("POST") approach and remove the incorrect claim that streaming uploads are unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100