diff --git a/documentation/manual/releases/release26/migration26/WSMigration26.md b/documentation/manual/releases/release26/migration26/WSMigration26.md index 797dae3167a..0fa07ef2d97 100644 --- a/documentation/manual/releases/release26/migration26/WSMigration26.md +++ b/documentation/manual/releases/release26/migration26/WSMigration26.md @@ -1,10 +1,12 @@ # Play WS Migration Guide -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: +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: ```scala libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone" % "1.0.0" +libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone-json" % "1.0.0" +libraryDependencies += "com.typesafe.play" %% "play-ahc-ws-standalone-xml" % "1.0.0" ``` ## Package changes @@ -61,6 +63,8 @@ play.api.test.WsTestClient.withClient { ws => The `ning` package has been replaced by the `ahc` package, and the Ning* classes replaced by AHC*. +A normal `WSResponse` instance is returned from `stream()` instead of `StreamedResponse`. You should call `response.bodyAsSource` to return the streamed result. + ### Java 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); ... ws.close(); ``` + +A normal `WSResponse` instance is returned from `stream()` instead of `StreamedResponse`. You should call `response.getBodyAsSource()` to return the streamed result. \ No newline at end of file diff --git a/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWS.java b/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWS.java index 1b1b2e7c7ad..26957fd73bc 100644 --- a/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWS.java +++ b/documentation/manual/working/javaGuide/main/ws/code/javaguide/ws/JavaWS.java @@ -9,8 +9,6 @@ // #ws-imports import org.slf4j.Logger; import play.api.Configuration; -import play.api.libs.ws.InMemoryBody; -import play.core.j.HttpExecutionContext; import play.core.j.JavaHandlerComponents; import play.libs.concurrent.Futures; import play.libs.ws.*; @@ -20,8 +18,6 @@ import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.Arrays; -import java.util.List; -import java.util.Map; import java.util.concurrent.*; // #ws-imports diff --git a/documentation/manual/working/scalaGuide/main/ws/ScalaWS.md b/documentation/manual/working/scalaGuide/main/ws/ScalaWS.md index 8967c66e12c..a424758cacc 100644 --- a/documentation/manual/working/scalaGuide/main/ws/ScalaWS.md +++ b/documentation/manual/working/scalaGuide/main/ws/ScalaWS.md @@ -278,7 +278,7 @@ Play WS comes with rich type support for bodies in the form of [`play.api.libs.w ### Creating a Custom Readable -You can create a custom readable by accessing the AHC response body: +You can create a custom readable by accessing the response body: @[ws-custom-body-readable](code/ScalaWSSpec.scala)