class StreamedResponse extends StandaloneWSResponse with CookieBuilder
A streamed response containing a response header and a streamable body.
Note that this is only usable with a stream call, i.e.
import scala.concurrent.{ ExecutionContext, Future } import org.apache.pekko.util.ByteString import org.apache.pekko.stream.scaladsl.Source import play.api.libs.ws.DefaultBodyReadables._ import play.api.libs.ws.ahc.StandaloneAhcWSClient class MyClass(ws: StandaloneAhcWSClient) { def doIt(implicit ec: ExecutionContext): Future[String] = ws.url("http://example.com").stream().map { response => val _ = response.body[Source[ByteString, _]] ??? // process source to String } }
- Alphabetic
- By Inheritance
- StreamedResponse
- CookieBuilder
- WSCookieConverter
- StandaloneWSResponse
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StreamedResponse(client: StandaloneAhcWSClient, status: Int, statusText: String, uri: URI, headers: Map[String, Seq[String]], publisher: Publisher[HttpResponseBodyPart], useLaxCookieEncoder: Boolean)
- new StreamedResponse(client: StandaloneAhcWSClient, status: Int, statusText: String, uri: URI, publisher: Publisher[HttpResponseBodyPart], useLaxCookieEncoder: Boolean)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def asCookie(c: Cookie): WSCookie
- Definition Classes
- WSCookieConverter
- def asCookie(cookie: WSCookie): Cookie
- Definition Classes
- WSCookieConverter
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def body[T](implicit arg0: BodyReadable[T]): T
- Definition Classes
- StandaloneWSResponse
- lazy val body: String
THIS IS A BLOCKING OPERATION.
THIS IS A BLOCKING OPERATION. It should not be used in production.
Note that this is not a charset aware operation, as the stream does not have access to the underlying machinery that disambiguates responses.
- returns
the body as a String
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- lazy val bodyAsBytes: ByteString
THIS IS A BLOCKING OPERATION.
THIS IS A BLOCKING OPERATION. It should not be used in production.
Note that this is not a charset aware operation, as the stream does not have access to the underlying machinery that disambiguates responses.
- returns
the body as a ByteString
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- lazy val bodyAsSource: Source[ByteString, _]
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- def buildCookies(headers: Map[String, Seq[String]]): Seq[WSCookie]
- Definition Classes
- CookieBuilder
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def contentType: String
- Definition Classes
- StandaloneWSResponse
- def cookie(name: String): Option[WSCookie]
Get only one cookie, using the cookie name.
Get only one cookie, using the cookie name.
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- lazy val cookies: Seq[WSCookie]
Get all the cookies.
Get all the cookies.
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def header(name: String): Option[String]
- Definition Classes
- StandaloneWSResponse
- def headerValues(name: String): Seq[String]
- Definition Classes
- StandaloneWSResponse
- lazy val headers: Map[String, Seq[String]]
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val status: Int
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- val statusText: String
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def underlying[T]: T
Get the underlying response object.
Get the underlying response object.
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- val uri: URI
- Definition Classes
- StreamedResponse → StandaloneWSResponse
- val useLaxCookieEncoder: Boolean
- Definition Classes
- StreamedResponse → CookieBuilder
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)