| Modifier and Type | Field and Description |
|---|---|
protected play.api.mvc.Request<Http.RequestBody> |
req |
| Constructor and Description |
|---|
RequestBuilder()
Returns a simple request builder.
|
RequestBuilder(play.api.mvc.request.RequestFactory requestFactory)
Returns a simple request builder.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Http.RequestBuilder |
attr(TypedKey<T> key,
T value)
Add an attribute to the request.
|
TypedMap |
attrs()
Get the request attributes.
|
Http.RequestBuilder |
attrs(TypedMap newAttrs)
Update the request attributes.
|
Http.RequestBody |
body() |
protected Http.RequestBuilder |
body(Http.RequestBody body)
Set the body of the request.
|
protected Http.RequestBuilder |
body(Http.RequestBody body,
String contentType)
Set the body of the request.
|
Http.RequestBuilder |
bodyForm(Map<String,String> data)
Set a Form url encoded body to this request.
|
Http.RequestBuilder |
bodyFormArrayValues(Map<String,String[]> data)
Set a Form url encoded body to this request.
|
Http.RequestBuilder |
bodyJson(com.fasterxml.jackson.databind.JsonNode node)
Set a Json Body to this request.
|
Http.RequestBuilder |
bodyJson(play.api.libs.json.JsValue json)
Set a Json Body to this request.
|
Http.RequestBuilder |
bodyMultipart(List<Http.MultipartFormData.Part<Source<ByteString,?>>> data,
Files.TemporaryFileCreator temporaryFileCreator,
Materializer mat)
Set a Multipart Form url encoded body to this request.
|
Http.RequestBuilder |
bodyRaw(byte[] data)
Set a Binary Data to this request using a singleton temporary file creator.
|
Http.RequestBuilder |
bodyRaw(byte[] data,
Files.TemporaryFileCreator tempFileCreator)
Set a Binary Data to this request.
|
Http.RequestBuilder |
bodyRaw(ByteString data)
Set a Binary Data to this request using a singleton temp file creator
The Content-Type header of the request is set to application/octet-stream.
|
Http.RequestBuilder |
bodyRaw(ByteString data,
Files.TemporaryFileCreator tempFileCreator)
Set a Binary Data to this request.
|
Http.RequestBuilder |
bodyText(String text)
Set a Text to this request.
|
Http.RequestBuilder |
bodyXml(Document xml)
Set a XML to this request.
|
Http.RequestBuilder |
bodyXml(InputSource xml)
Set a XML to this request.
|
Http.RequestImpl |
build()
Builds the request.
|
Optional<List<X509Certificate>> |
clientCertificateChain() |
Http.RequestBuilder |
clientCertificateChain(List<X509Certificate> clientCertificateChain) |
Http.RequestBuilder |
cookie(Http.Cookie cookie)
Sets one cookie.
|
Http.Cookies |
cookies() |
Map<String,String> |
flash() |
Http.RequestBuilder |
flash(Map<String,String> data)
Sets cookies in a request.
|
Http.RequestBuilder |
flash(String key,
String value)
Sets a cookie in the request.
|
Http.Headers |
getHeaders() |
String |
header(String key)
Deprecated.
As of release 2.6, use
getHeaders() instead. |
Http.RequestBuilder |
header(String key,
List<String> values) |
Http.RequestBuilder |
header(String key,
String value) |
Http.RequestBuilder |
header(String key,
String[] values)
Deprecated.
As of release 2.6, use
header(String, List) instead. |
Map<String,String[]> |
headers()
Deprecated.
As of release 2.6, use
getHeaders() instead. |
Http.RequestBuilder |
headers(Http.Headers headers)
Set the headers to be used by the request builder.
|
Http.RequestBuilder |
headers(Map<String,String[]> headers)
Deprecated.
As of release 2.6, use
#headers(Headers) instead. |
String[] |
headers(String key)
Deprecated.
As of release 2.6, use
getHeaders() instead. |
String |
host() |
Http.RequestBuilder |
host(String host) |
Long |
id() |
Http.RequestBuilder |
id(Long id) |
String |
method() |
Http.RequestBuilder |
method(String method) |
String |
path() |
Http.RequestBuilder |
path(String path)
This method sets the path of the uri.
|
String |
remoteAddress() |
Http.RequestBuilder |
remoteAddress(String remoteAddress) |
boolean |
secure() |
Http.RequestBuilder |
secure(boolean secure) |
Map<String,String> |
session() |
Http.RequestBuilder |
session(Map<String,String> data)
Sets all parameters for the session.
|
Http.RequestBuilder |
session(String key,
String value)
Sets a session.
|
Http.RequestBuilder |
tag(String key,
String value)
Deprecated.
Use
attr(key, value) instead. |
Map<String,String> |
tags()
Deprecated.
Use typed attributes, i.e.
attrs(), instead. |
Http.RequestBuilder |
tags(Map<String,String> tags)
Deprecated.
Use
attrs(...) instead. |
String |
uri() |
Http.RequestBuilder |
uri(String str)
Sets the uri.
|
Http.RequestBuilder |
uri(URI uri) |
String |
username()
Deprecated.
Use
attrs().get(Security.USERNAME) or attrs().getOptional(Security.USERNAME) instead. |
Http.RequestBuilder |
username(String username)
Deprecated.
Use
attr(Security.USERNAME, username) instead. |
String |
version() |
Http.RequestBuilder |
version(String version) |
protected play.api.mvc.Request<Http.RequestBody> req
public RequestBuilder()
public RequestBuilder(play.api.mvc.request.RequestFactory requestFactory)
requestFactory - the incoming request factorypublic Http.RequestBody body()
@Deprecated public String username()
attrs().get(Security.USERNAME) or attrs().getOptional(Security.USERNAME) instead.attrs().getOptional(Security.USERNAME).@Deprecated public Http.RequestBuilder username(String username)
attr(Security.USERNAME, username) instead.attr(Security.USERNAME, username).username - the username for the requestprotected Http.RequestBuilder body(Http.RequestBody body, String contentType)
body - the bodycontentType - Content-Type header valueprotected Http.RequestBuilder body(Http.RequestBody body)
body - The body.public Http.RequestBuilder bodyRaw(ByteString data)
data - the Binary Datapublic Http.RequestBuilder bodyRaw(ByteString data, Files.TemporaryFileCreator tempFileCreator)
data - the Binary DatatempFileCreator - the temporary file creator for binary data.public Http.RequestBuilder bodyRaw(byte[] data)
data - the Binary Datapublic Http.RequestBuilder bodyRaw(byte[] data, Files.TemporaryFileCreator tempFileCreator)
data - the Binary DatatempFileCreator - the temporary file creator for binary data.public Http.RequestBuilder bodyFormArrayValues(Map<String,String[]> data)
data - the x-www-form-urlencoded parameterspublic Http.RequestBuilder bodyForm(Map<String,String> data)
data - the x-www-form-urlencoded parameterspublic Http.RequestBuilder bodyMultipart(List<Http.MultipartFormData.Part<Source<ByteString,?>>> data, Files.TemporaryFileCreator temporaryFileCreator, Materializer mat)
data - the multipart-form parameterstemporaryFileCreator - the temporary file creator.mat - a Akka Streams Materializerpublic Http.RequestBuilder bodyJson(com.fasterxml.jackson.databind.JsonNode node)
node - the Json Nodepublic Http.RequestBuilder bodyJson(play.api.libs.json.JsValue json)
json - the JsValuepublic Http.RequestBuilder bodyXml(InputSource xml)
xml - the XMLpublic Http.RequestBuilder bodyXml(Document xml)
xml - the XMLpublic Http.RequestBuilder bodyText(String text)
text - the textpublic Http.RequestImpl build()
public Long id()
public Http.RequestBuilder id(Long id)
id - the id to be usedpublic <T> Http.RequestBuilder attr(TypedKey<T> key, T value)
T - The type of the attribute to add.key - The key of the attribute to add.value - The value of the attribute to add.public Http.RequestBuilder attrs(TypedMap newAttrs)
newAttrs - The attribute entries to add.public TypedMap attrs()
@Deprecated public Map<String,String> tags()
attrs(), instead.@Deprecated public Http.RequestBuilder tags(Map<String,String> tags)
attrs(...) instead.tags - overwrites the tags for this request@Deprecated public Http.RequestBuilder tag(String key, String value)
attr(key, value) instead.key - the key for the tagvalue - the value for the tagpublic String method()
public Http.RequestBuilder method(String method)
method - sets the methodpublic String uri()
public Http.RequestBuilder uri(URI uri)
public Http.RequestBuilder uri(String str)
str - the uripublic Http.RequestBuilder secure(boolean secure)
secure - true if the request is securepublic boolean secure()
public String host()
public Http.RequestBuilder host(String host)
host - sets the host in the headerpublic String path()
public Http.RequestBuilder path(String path)
path - the path after the port and for the query in a uripublic String version()
public Http.RequestBuilder version(String version)
version - the version@Deprecated public String header(String key)
getHeaders() instead.key - the key to be used in the header@Deprecated public String[] headers(String key)
getHeaders() instead.key - the key to be used in the header@Deprecated public Map<String,String[]> headers()
getHeaders() instead.public Http.Headers getHeaders()
@Deprecated public Http.RequestBuilder headers(Map<String,String[]> headers)
#headers(Headers) instead.headers - the headers to be replacedpublic Http.RequestBuilder headers(Http.Headers headers)
headers - the headers to be replaced@Deprecated public Http.RequestBuilder header(String key, String[] values)
header(String, List) instead.key - the key for in the headervalues - the values associated with the keypublic Http.RequestBuilder header(String key, List<String> values)
key - the key for in the headervalues - the values associated with the keypublic Http.RequestBuilder header(String key, String value)
key - the key for in the headervalue - the value (one) associated with the keypublic Http.Cookies cookies()
public Http.RequestBuilder cookie(Http.Cookie cookie)
cookie - the cookie to be setpublic Http.RequestBuilder flash(String key, String value)
key - the key for the cookievalue - the value for the cookiepublic Http.RequestBuilder flash(Map<String,String> data)
data - a key value mapping of cookiespublic Http.RequestBuilder session(String key, String value)
key - the key for the sessionvalue - the value associated with the key for the sessionpublic Http.RequestBuilder session(Map<String,String> data)
data - a key value mapping of the session datapublic String remoteAddress()
public Http.RequestBuilder remoteAddress(String remoteAddress)
remoteAddress - sets the remote addresspublic Optional<List<X509Certificate>> clientCertificateChain()
public Http.RequestBuilder clientCertificateChain(List<X509Certificate> clientCertificateChain)
clientCertificateChain - sets the X509Certificates to use