public static final class Http.RequestBody
extends java.lang.Object
Constructor and Description |
---|
RequestBody(java.lang.Object body) |
Modifier and Type | Method and Description |
---|---|
<T> T |
as(java.lang.Class<T> tType)
Cast this RequestBody as T if possible.
|
akka.util.ByteString |
asBytes()
The request content as a ByteString.
|
java.util.Map<java.lang.String,java.lang.String[]> |
asFormUrlEncoded()
The request content parsed as URL form-encoded.
|
com.fasterxml.jackson.databind.JsonNode |
asJson()
The request content as Json.
|
<A> Http.MultipartFormData<A> |
asMultipartFormData()
The request content parsed as multipart form data.
|
Http.RawBuffer |
asRaw()
The request content as Array bytes.
|
java.lang.String |
asText()
The request content as text.
|
org.w3c.dom.Document |
asXml()
The request content as XML.
|
java.lang.String |
toString() |
public <A> Http.MultipartFormData<A> asMultipartFormData()
A
- the file type (e.g. play.api.libs.Files.TemporaryFile)public java.util.Map<java.lang.String,java.lang.String[]> asFormUrlEncoded()
public Http.RawBuffer asRaw()
public java.lang.String asText()
public org.w3c.dom.Document asXml()
public com.fasterxml.jackson.databind.JsonNode asJson()
public akka.util.ByteString asBytes()
This makes a best effort attempt to convert the parsed body to a ByteString, if it knows how. This includes String, json, XML and form bodies. It doesn't include multipart/form-data or raw bodies that don't fit in the configured max memory buffer, nor does it include custom output types from custom body parsers.
public <T> T as(java.lang.Class<T> tType)
T
- type of the provided tType
tType
- class that we are trying to cast the body aspublic java.lang.String toString()
toString
in class java.lang.Object