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.
|
<A> java.util.Optional<A> |
parseJson(java.lang.Class<A> clazz)
Converts a JSON request to a given class.
|
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 <A> java.util.Optional<A> parseJson(java.lang.Class<A> clazz)
A
- The type to convert the JSON value to.clazz
- The class to convert the JSON value to.public akka.util.ByteString asBytes()
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