public static interface Http.RequestHeader
Modifier and Type | Method and Description |
---|---|
java.util.List<play.api.http.MediaRange> |
acceptedTypes() |
java.util.List<Lang> |
acceptLanguages()
The Request Langs extracted from the Accept-Language header and sorted by preference
(preferred first).
|
boolean |
accepts(java.lang.String mimeType)
Check if this request accepts a given media type.
|
<A> Http.RequestHeader |
addAttr(TypedKey<A> key,
A value)
Create a new versions of this object with the given attribute attached to it.
|
play.api.mvc.RequestHeader |
asScala() |
TypedMap |
attrs() |
java.util.Optional<java.lang.String> |
charset() |
java.util.Optional<java.util.List<java.security.cert.X509Certificate>> |
clientCertificateChain()
The X509 certificate chain presented by a client during SSL requests.
|
java.util.Optional<java.lang.String> |
contentType() |
Http.Cookie |
cookie(java.lang.String name)
Deprecated.
Deprecated as of 2.8.0. Use
getCookie(String) instead. |
Http.Cookies |
cookies() |
default Http.Flash |
flash()
Parses the Flash cookie and returns the Flash data.
|
java.util.Optional<Http.Cookie> |
getCookie(java.lang.String name) |
Http.Headers |
getHeaders()
Retrieve all headers.
|
java.lang.String |
getQueryString(java.lang.String key)
Deprecated.
Deprecated as of 2.8.0. Use
queryString(String) instead. |
boolean |
hasBody() |
default boolean |
hasHeader(java.lang.String headerName)
Checks if the request has the header.
|
default java.util.Optional<java.lang.String> |
header(java.lang.String headerName)
Retrieves a single header.
|
java.lang.String |
host() |
default java.lang.Long |
id()
The request id.
|
java.lang.String |
method() |
java.lang.String |
path() |
java.util.Map<java.lang.String,java.lang.String[]> |
queryString()
The query string content.
|
java.util.Optional<java.lang.String> |
queryString(java.lang.String key)
Helper method to access a queryString parameter.
|
java.lang.String |
remoteAddress()
The client IP address.
|
Http.RequestHeader |
removeAttr(TypedKey<?> key)
Create a new versions of this object with the given attribute removed.
|
boolean |
secure() |
default Http.Session |
session()
Parses the Session cookie and returns the Session data.
|
default java.util.Optional<Lang> |
transientLang()
The transient language will be taken into account when using
MessagesApi#preferred(RequestHeader) } (It will take precedence over any other language). |
java.lang.String |
uri() |
java.lang.String |
version() |
Http.RequestHeader |
withAttrs(TypedMap newAttrs)
Create a new version of this object with the given attributes attached to it.
|
Http.Request |
withBody(Http.RequestBody body)
Attach a body to this header.
|
default Http.RequestHeader |
withoutTransientLang()
Create a new version of this object with the given transient language removed.
|
default Http.RequestHeader |
withTransientLang(Lang lang)
Create a new version of this object with the given transient language set.
|
default Http.RequestHeader |
withTransientLang(java.util.Locale locale)
Create a new version of this object with the given transient language set.
|
default Http.RequestHeader |
withTransientLang(java.lang.String code)
Deprecated.
Deprecated as of 2.8.0 Use
withTransientLang(Lang) instead. |
default java.lang.Long id()
RequestAttrKey.Id()
.java.lang.String uri()
java.lang.String method()
java.lang.String version()
java.lang.String remoteAddress()
Retrieves the last untrusted proxy from the Forwarded-Headers or the X-Forwarded-*-Headers.
boolean secure()
TypedMap attrs()
Http.RequestHeader withAttrs(TypedMap newAttrs)
newAttrs
- The new attributes to add.<A> Http.RequestHeader addAttr(TypedKey<A> key, A value)
A
- the attribute typekey
- The new attribute key.value
- The attribute value.Http.RequestHeader removeAttr(TypedKey<?> key)
key
- The key of the attribute to remove.Http.Request withBody(Http.RequestBody body)
body
- The body to attach.java.lang.String host()
java.lang.String path()
java.util.List<Lang> acceptLanguages()
java.util.List<play.api.http.MediaRange> acceptedTypes()
boolean accepts(java.lang.String mimeType)
mimeType
- the mimeType to check for support.mimeType
is in the Accept header, otherwise falsejava.util.Map<java.lang.String,java.lang.String[]> queryString()
@Deprecated java.lang.String getQueryString(java.lang.String key)
queryString(String)
instead.key
- the query string parameter to look upkey
.java.util.Optional<java.lang.String> queryString(java.lang.String key)
key
- the query string parameter to look upkey
, if it exists.Http.Cookies cookies()
@Deprecated Http.Cookie cookie(java.lang.String name)
getCookie(String)
instead.name
- Name of the cookie to retrievejava.util.Optional<Http.Cookie> getCookie(java.lang.String name)
name
- Name of the cookie to retrievedefault Http.Session session()
RequestAttrKey.Session()
. The attribute uses a
Cell
to store the session cookie, to allow it to be evaluated on-demand.default Http.Flash flash()
RequestAttrKey.Flash()
}. The attribute uses a Cell
to
store the flash, to allow it to be evaluated on-demand.Http.Headers getHeaders()
default java.util.Optional<java.lang.String> header(java.lang.String headerName)
headerName
- The name of the header (case-insensitive)headerName
, or empty if it was not presentdefault boolean hasHeader(java.lang.String headerName)
headerName
- The name of the header (case-insensitive)true
if the request did contain the header.boolean hasBody()
java.util.Optional<java.lang.String> contentType()
java.util.Optional<java.lang.String> charset()
java.util.Optional<java.util.List<java.security.cert.X509Certificate>> clientCertificateChain()
default Http.RequestHeader withTransientLang(Lang lang)
MessagesApi#preferred(RequestHeader)
}
(It will take precedence over any other language).lang
- The language to use.@Deprecated default Http.RequestHeader withTransientLang(java.lang.String code)
withTransientLang(Lang)
instead.MessagesApi#preferred(RequestHeader)
}
(It will take precedence over any other language).code
- The language to use.default Http.RequestHeader withTransientLang(java.util.Locale locale)
MessagesApi#preferred(RequestHeader)
}
(It will take precedence over any other language).locale
- The language to use.default Http.RequestHeader withoutTransientLang()
default java.util.Optional<Lang> transientLang()
MessagesApi#preferred(RequestHeader)
} (It will take precedence over any other language).play.api.mvc.RequestHeader asScala()
RequestHeader