play.api.libs.ws
Provides implicit type classes when you import the package.
Attributes
Members list
Type members
Classlikes
JSON, XML and Multipart Form Data Readables used for Play-WS bodies.
JSON, XML and Multipart Form Data Readables used for Play-WS bodies.
Attributes
- Companion
- object
- Supertypes
-
trait XMLBodyReadablestrait JsonBodyReadablestrait DefaultBodyReadablesclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object WSBodyReadables.typetrait WSResponse
Attributes
- Companion
- trait
- Supertypes
-
trait WSBodyReadablestrait XMLBodyReadablestrait JsonBodyReadablestrait DefaultBodyReadablesclass Objecttrait Matchableclass AnyShow all
- Self type
-
WSBodyReadables.type
JSON, XML and Multipart Form Data Writables used for Play-WS bodies.
JSON, XML and Multipart Form Data Writables used for Play-WS bodies.
Attributes
- Companion
- object
- Supertypes
-
trait XMLBodyWritablestrait JsonBodyWritablestrait DefaultBodyWritablesclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object WSBodyWritables.typetrait WSRequest
Attributes
- Companion
- trait
- Supertypes
-
trait WSBodyWritablestrait XMLBodyWritablestrait JsonBodyWritablestrait DefaultBodyWritablesclass Objecttrait Matchableclass AnyShow all
- Self type
-
WSBodyWritables.type
A Play specific WS client that can use Play specific classes in the request and response building.
A Play specific WS client that can use Play specific classes in the request and response building.
Typically, access this class through dependency injection, i.e.
class MyService @Inject()(ws: WSClient) {
val response: Future[WSResponse] = ws.url("https://example.com").get()
}
Please see the documentation at https://www.playframework.com/documentation/latest/ScalaWS for more details.
Attributes
- Supertypes
-
trait Closeabletrait AutoCloseableclass Objecttrait Matchableclass Any
A WS Request builder.
A WS Request builder.
Attributes
- Supertypes
-
trait WSBodyWritablestrait XMLBodyWritablestrait JsonBodyWritablestrait DefaultBodyWritablestrait StandaloneWSRequestclass Objecttrait Matchableclass AnyShow all
A WS Response that can use Play specific classes.
A WS Response that can use Play specific classes.
Attributes
- Supertypes
-
trait WSBodyReadablestrait XMLBodyReadablestrait JsonBodyReadablestrait DefaultBodyReadablestrait StandaloneWSResponseclass Objecttrait Matchableclass AnyShow all
Value members
Inherited methods
Attributes
- Inherited from:
- JsonBodyWritables
Implicits
Inherited implicits
Attributes
- Inherited from:
- WSBodyWritables
Converts a response body into Array[Byte]
.
Converts a response body into Array[Byte]
.
import play.api.libs.ws.DefaultBodyReadables._
def example(response: play.api.libs.ws.StandaloneWSResponse): Array[Byte] =
response.body[Array[Byte]]
Attributes
- Inherited from:
- DefaultBodyReadables
Converts a response body into a read only ByteBuffer
.
Converts a response body into a read only ByteBuffer
.
import java.nio.ByteBuffer
import play.api.libs.ws.DefaultBodyReadables._
def example(response: play.api.libs.ws.StandaloneWSResponse): ByteBuffer =
response.body[ByteBuffer]
Attributes
- Inherited from:
- DefaultBodyReadables
Converts a response body into an akka.util.ByteString
:
Converts a response body into an akka.util.ByteString
:
import akka.util.ByteString
import play.api.libs.ws.DefaultBodyReadables._
def example(response: play.api.libs.ws.StandaloneWSResponse): ByteString =
response.body[ByteString]
Attributes
- Inherited from:
- DefaultBodyReadables
Converts a response body into Play JSON format:
Converts a response body into Play JSON format:
import play.api.libs.ws.StandaloneWSResponse
import play.api.libs.ws.JsonBodyReadables._
def json(r: StandaloneWSResponse) = r.body[play.api.libs.json.JsValue]
Attributes
- Inherited from:
- JsonBodyReadables
Converts a response body into Source[ByteString, _]
.
Converts a response body into Source[ByteString, _]
.
Attributes
- Inherited from:
- DefaultBodyReadables
Converts a response body into a String
.
Converts a response body into a String
.
Note: this is only a best-guess effort and does not handle all content types. See StandaloneWSResponse.body:String* for more information.
import play.api.libs.ws.DefaultBodyReadables._
def example(response: play.api.libs.ws.StandaloneWSResponse): String =
response.body[String]
Attributes
- Inherited from:
- DefaultBodyReadables
Converts a response body into XML document:
Converts a response body into XML document:
import scala.xml.Elem
import play.api.libs.ws.StandaloneWSResponse
import play.api.libs.ws.XMLBodyReadables._
def foo(resp: StandaloneWSResponse): Elem = resp.body[Elem]
Attributes
- Inherited from:
- XMLBodyReadables
Creates an SourceBody with "application/octet-stream" content type from a file.
Creates an SourceBody with "application/octet-stream" content type from a file.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an SourceBody with "application/octet-stream" content type from an inputstream.
Creates an SourceBody with "application/octet-stream" content type from an inputstream.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an SourceBody with "application/octet-stream" content type from a file.
Creates an SourceBody with "application/octet-stream" content type from a file.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "application/octet-stream" content type from an array of bytes.
Creates an InMemoryBody with "application/octet-stream" content type from an array of bytes.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.
Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "application/octet-stream" content type.
Creates an InMemoryBody with "application/octet-stream" content type.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "text/xml" content type.
Creates an InMemoryBody with "text/xml" content type.
Attributes
- Inherited from:
- XMLBodyWritables
Creates an InMemoryBody with "application/json" content type, using the static ObjectMapper.
Creates an InMemoryBody with "application/json" content type, using the static ObjectMapper.
Attributes
- Inherited from:
- JsonBodyWritables
Creates an InMemoryBody with "text/xml" content type.
Creates an InMemoryBody with "text/xml" content type.
Attributes
- Inherited from:
- XMLBodyWritables
Creates an InMemoryBody with "text/xml" content type.
Creates an InMemoryBody with "text/xml" content type.
Attributes
- Inherited from:
- XMLBodyWritables
Creates an InMemoryBody with "text/plain" content type.
Creates an InMemoryBody with "text/plain" content type.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "text/plain" content type from a StringBuilder
Creates an InMemoryBody with "text/plain" content type from a StringBuilder
Attributes
- Inherited from:
- DefaultBodyWritables
Creates a BodyWritable with an identity function, with "application/octet-stream" content type.
Creates a BodyWritable with an identity function, with "application/octet-stream" content type.
Attributes
- Inherited from:
- DefaultBodyWritables
Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.
Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.
Attributes
- Inherited from:
- DefaultBodyWritables
Attributes
- Inherited from:
- DefaultBodyWritables