Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfac489

Browse files
committed
Clean up imports, add migration note
1 parent 374fc43 commit cfac489

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

documentation/manual/releases/release26/migration26/WSMigration26.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<!--- Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com> -->
22
# Play WS Migration Guide
33

4-
Play WS is now a standalone project and is available at https://github.com/playframework/play-ws. It can be added to an SBT project with:
4+
Play WS is now a standalone project and is available at [https://github.com/playframework/play-ws](https://github.com/playframework/play-ws). It can be added to an SBT project with:
55

66
```scala
77
libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone" % "1.0.0"
8+
libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone-json" % "1.0.0"
9+
libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone-xml" % "1.0.0"
810
```
911

1012
## Package changes
@@ -61,6 +63,8 @@ play.api.test.WsTestClient.withClient { ws =>
6163

6264
The `ning` package has been replaced by the `ahc` package, and the Ning* classes replaced by AHC*.
6365

66+
A normal `WSResponse` instance is returned from `stream()` instead of `StreamedResponse`. You should call `response.bodyAsSource` to return the streamed result.
67+
6468
### Java
6569

6670
In Java, the `play.libs.ws.WS` class has been deprecated. An injected `WSClient` instance should be used instead.
@@ -89,3 +93,5 @@ WSClient ws = play.test.WsTestClient.newClient(19001);
8993
...
9094
ws.close();
9195
```
96+
97+
A normal `WSResponse` instance is returned from `stream()` instead of `StreamedResponse`. You should call `response.getBodyAsSource()` to return the streamed result.

documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWS.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// #ws-imports
1010
import org.slf4j.Logger;
1111
import play.api.Configuration;
12-
import play.api.libs.ws.InMemoryBody;
13-
import play.core.j.HttpExecutionContext;
1412
import play.core.j.JavaHandlerComponents;
1513
import play.libs.concurrent.Futures;
1614
import play.libs.ws.*;
@@ -20,8 +18,6 @@
2018
import java.time.Duration;
2119
import java.time.temporal.ChronoUnit;
2220
import java.util.Arrays;
23-
import java.util.List;
24-
import java.util.Map;
2521
import java.util.concurrent.*;
2622
// #ws-imports
2723

documentation/manual/working/scalaGuide/main/ws/ScalaWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Play WS comes with rich type support for bodies in the form of [`play.api.libs.w
278278

279279
### Creating a Custom Readable
280280

281-
You can create a custom readable by accessing the AHC response body:
281+
You can create a custom readable by accessing the response body:
282282

283283
@[ws-custom-body-readable](code/ScalaWSSpec.scala)
284284

0 commit comments

Comments
 (0)