public static class Http.RequestBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Http.RequestBody |
body |
protected java.util.Optional<java.util.List<java.security.cert.X509Certificate>> |
clientCertificateChain |
protected java.util.Map<java.lang.String,java.lang.String[]> |
headers |
protected java.lang.Long |
id |
protected java.lang.String |
method |
protected java.lang.String |
remoteAddress |
protected boolean |
secure |
protected java.util.Map<java.lang.String,java.lang.String> |
tags |
protected java.net.URI |
uri |
protected java.lang.String |
username |
protected java.lang.String |
version |
Constructor and Description |
---|
RequestBuilder()
Returns a simple request builder, based on get and local address.
|
Modifier and Type | Method and Description |
---|---|
Http.RequestBody |
body() |
protected Http.RequestBuilder |
body(Http.RequestBody body)
Set the body of the request.
|
protected Http.RequestBuilder |
body(Http.RequestBody body,
java.lang.String contentType)
Set the body of the request.
|
Http.RequestBuilder |
bodyForm(java.util.Map<java.lang.String,java.lang.String> data)
Set a Form url encoded body to this request.
|
Http.RequestBuilder |
bodyFormArrayValues(java.util.Map<java.lang.String,java.lang.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(java.util.List<Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>> data,
akka.stream.Materializer mat)
Set a Multipart Form url encoded body to this request.
|
Http.RequestBuilder |
bodyRaw(byte[] data)
Set a Binary Data to this request.
|
Http.RequestBuilder |
bodyRaw(akka.util.ByteString data)
Set a Binary Data to this request.
|
Http.RequestBuilder |
bodyText(java.lang.String text)
Set a Text to this request.
|
Http.RequestBuilder |
bodyXml(org.w3c.dom.Document xml)
Set a XML to this request.
|
Http.RequestBuilder |
bodyXml(org.xml.sax.InputSource xml)
Set a XML to this request.
|
Http.RequestImpl |
build()
Builds the request.
|
protected play.api.mvc.Headers |
buildHeaders() |
java.util.Optional<java.util.List<java.security.cert.X509Certificate>> |
clientCertificateChain() |
Http.RequestBuilder |
clientCertificateChain(java.util.List<java.security.cert.X509Certificate> clientCertificateChain) |
Http.RequestBuilder |
cookie(Http.Cookie cookie)
Sets one cookie.
|
Http.Cookies |
cookies() |
java.util.Map<java.lang.String,java.lang.String> |
flash() |
Http.RequestBuilder |
flash(java.util.Map<java.lang.String,java.lang.String> data)
Sets cookies in a request.
|
Http.RequestBuilder |
flash(java.lang.String key,
java.lang.String value)
Sets a cookie in the request.
|
java.lang.String |
header(java.lang.String key) |
Http.RequestBuilder |
header(java.lang.String key,
java.lang.String value) |
Http.RequestBuilder |
header(java.lang.String key,
java.lang.String[] values) |
java.util.Map<java.lang.String,java.lang.String[]> |
headers() |
Http.RequestBuilder |
headers(java.util.Map<java.lang.String,java.lang.String[]> headers) |
java.lang.String[] |
headers(java.lang.String key) |
java.lang.String |
host() |
Http.RequestBuilder |
host(java.lang.String host) |
java.lang.Long |
id() |
Http.RequestBuilder |
id(java.lang.Long id) |
protected static scala.collection.immutable.Map<java.lang.String,scala.collection.Seq<java.lang.String>> |
mapListToScala(java.util.Map<java.lang.String,java.util.List<java.lang.String>> data) |
java.lang.String |
method() |
Http.RequestBuilder |
method(java.lang.String method) |
java.lang.String |
path() |
Http.RequestBuilder |
path(java.lang.String path)
This method sets the path of the uri.
|
java.lang.String |
remoteAddress() |
Http.RequestBuilder |
remoteAddress(java.lang.String remoteAddress) |
boolean |
secure() |
Http.RequestBuilder |
secure(boolean secure) |
java.util.Map<java.lang.String,java.lang.String> |
session() |
Http.RequestBuilder |
session(java.util.Map<java.lang.String,java.lang.String> data)
Sets all parameters for the session.
|
Http.RequestBuilder |
session(java.lang.String key,
java.lang.String value)
Sets a session.
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
splitQuery() |
Http.RequestBuilder |
tag(java.lang.String key,
java.lang.String value)
Puts an extra tag.
|
java.util.Map<java.lang.String,java.lang.String> |
tags() |
Http.RequestBuilder |
tags(java.util.Map<java.lang.String,java.lang.String> tags) |
java.lang.String |
uri() |
Http.RequestBuilder |
uri(java.lang.String str)
Sets the uri.
|
Http.RequestBuilder |
uri(java.net.URI uri) |
java.lang.String |
username() |
Http.RequestBuilder |
username(java.lang.String username) |
java.lang.String |
version() |
Http.RequestBuilder |
version(java.lang.String version) |
protected Http.RequestBody body
protected java.lang.String username
protected java.lang.Long id
protected java.util.Map<java.lang.String,java.lang.String> tags
protected java.lang.String method
protected boolean secure
protected java.net.URI uri
protected java.lang.String version
protected java.util.Map<java.lang.String,java.lang.String[]> headers
protected java.lang.String remoteAddress
protected java.util.Optional<java.util.List<java.security.cert.X509Certificate>> clientCertificateChain
public RequestBuilder()
public Http.RequestBody body()
public java.lang.String username()
public Http.RequestBuilder username(java.lang.String username)
username
- the username for the requestprotected Http.RequestBuilder body(Http.RequestBody body, java.lang.String contentType)
body
- the bodycontentType
- Content-Type header valueprotected Http.RequestBuilder body(Http.RequestBody body)
body
- The body.public Http.RequestBuilder bodyRaw(akka.util.ByteString data)
data
- the Binary Datapublic Http.RequestBuilder bodyRaw(byte[] data)
data
- the Binary Datapublic Http.RequestBuilder bodyFormArrayValues(java.util.Map<java.lang.String,java.lang.String[]> data)
data
- the x-www-form-urlencoded parameterspublic Http.RequestBuilder bodyForm(java.util.Map<java.lang.String,java.lang.String> data)
data
- the x-www-form-urlencoded parameterspublic Http.RequestBuilder bodyMultipart(java.util.List<Http.MultipartFormData.Part<akka.stream.javadsl.Source<akka.util.ByteString,?>>> data, akka.stream.Materializer mat)
data
- the multipart-form paramtersmat
- 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(org.xml.sax.InputSource xml)
xml
- the XMLpublic Http.RequestBuilder bodyXml(org.w3c.dom.Document xml)
xml
- the XMLpublic Http.RequestBuilder bodyText(java.lang.String text)
text
- the textpublic Http.RequestImpl build()
public java.lang.Long id()
public Http.RequestBuilder id(java.lang.Long id)
id
- the id to be usedpublic java.util.Map<java.lang.String,java.lang.String> tags()
public Http.RequestBuilder tags(java.util.Map<java.lang.String,java.lang.String> tags)
tags
- overwrites the tags for this requestpublic Http.RequestBuilder tag(java.lang.String key, java.lang.String value)
key
- the key for the tagvalue
- the value for the tagpublic java.lang.String method()
public Http.RequestBuilder method(java.lang.String method)
method
- sets the methodpublic java.lang.String uri()
public Http.RequestBuilder uri(java.net.URI uri)
public Http.RequestBuilder uri(java.lang.String str)
str
- the uripublic Http.RequestBuilder secure(boolean secure)
secure
- true if the request is securepublic boolean secure()
public java.lang.String host()
public Http.RequestBuilder host(java.lang.String host)
host
- sets the host in the headerpublic java.lang.String path()
public Http.RequestBuilder path(java.lang.String path)
path
- the path after the port and for the query in a uripublic java.lang.String version()
public Http.RequestBuilder version(java.lang.String version)
version
- the versionpublic java.lang.String header(java.lang.String key)
key
- the key to be used in the headerpublic java.lang.String[] headers(java.lang.String key)
key
- the key to be used in the headerpublic java.util.Map<java.lang.String,java.lang.String[]> headers()
public Http.RequestBuilder headers(java.util.Map<java.lang.String,java.lang.String[]> headers)
headers
- the headers to be replacedpublic Http.RequestBuilder header(java.lang.String key, java.lang.String[] values)
key
- the key for in the headervalues
- the values associated with the keypublic Http.RequestBuilder header(java.lang.String key, java.lang.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 java.util.Map<java.lang.String,java.lang.String> flash()
public Http.RequestBuilder flash(java.lang.String key, java.lang.String value)
key
- the key for the cookievalue
- the value for the cookiepublic Http.RequestBuilder flash(java.util.Map<java.lang.String,java.lang.String> data)
data
- a key value mapping of cookiespublic java.util.Map<java.lang.String,java.lang.String> session()
public Http.RequestBuilder session(java.lang.String key, java.lang.String value)
key
- the key for the sessionvalue
- the value associated with the key for the sessionpublic Http.RequestBuilder session(java.util.Map<java.lang.String,java.lang.String> data)
data
- a key value mapping of the session datapublic java.lang.String remoteAddress()
public Http.RequestBuilder remoteAddress(java.lang.String remoteAddress)
remoteAddress
- sets the remote addresspublic java.util.Optional<java.util.List<java.security.cert.X509Certificate>> clientCertificateChain()
public Http.RequestBuilder clientCertificateChain(java.util.List<java.security.cert.X509Certificate> clientCertificateChain)
clientCertificateChain
- sets the X509Certificates to useprotected java.util.Map<java.lang.String,java.util.List<java.lang.String>> splitQuery()
protected static scala.collection.immutable.Map<java.lang.String,scala.collection.Seq<java.lang.String>> mapListToScala(java.util.Map<java.lang.String,java.util.List<java.lang.String>> data)
protected play.api.mvc.Headers buildHeaders()