public static interface Http.RequestHeader
Modifier and Type | Method and Description |
---|---|
List<play.api.http.MediaRange> |
acceptedTypes() |
List<Lang> |
acceptLanguages()
The Request Langs extracted from the Accept-Language header and sorted by preference
(preferred first).
|
boolean |
accepts(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() |
Optional<String> |
charset() |
Optional<List<X509Certificate>> |
clientCertificateChain()
The X509 certificate chain presented by a client during SSL requests.
|
Optional<String> |
contentType() |
Http.Cookie |
cookie(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.
|
Optional<Http.Cookie> |
getCookie(String name) |
Http.Headers |
getHeaders()
Retrieve all headers.
|
String |
getQueryString(String key)
Deprecated.
Deprecated as of 2.8.0. Use
queryString(String) instead. |
boolean |
hasBody() |
default boolean |
hasHeader(String headerName)
Checks if the request has the header.
|
default Optional<String> |
header(String headerName)
Retrieves a single header.
|
String |
host() |
default Long |
id()
The request id.
|
String |
method() |
String |
path() |
Map<String,String[]> |
queryString()
The query string content.
|
Optional<String> |
queryString(String key)
Helper method to access a queryString parameter.
|
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 Optional<Lang> |
transientLang()
The transient language will be taken into account when using
MessagesApi#preferred(RequestHeader) } (It will take precedence over any other language). |
String |
uri() |
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(Locale locale)
Create a new version of this object with the given transient language set.
|
default Http.RequestHeader |
withTransientLang(String code)
Deprecated.
Deprecated as of 2.8.0 Use
withTransientLang(Lang) instead. |
default Long id()
RequestAttrKey.Id()
.String uri()
String method()
String version()
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.String host()
String path()
List<Lang> acceptLanguages()
List<play.api.http.MediaRange> acceptedTypes()
boolean accepts(String mimeType)
mimeType
- the mimeType to check for support.mimeType
is in the Accept header, otherwise falseMap<String,String[]> queryString()
@Deprecated String getQueryString(String key)
queryString(String)
instead.key
- the query string parameter to look upkey
.Optional<String> queryString(String key)
key
- the query string parameter to look upkey
, if it exists.Http.Cookies cookies()
@Deprecated Http.Cookie cookie(String name)
getCookie(String)
instead.name
- Name of the cookie to retrieveOptional<Http.Cookie> getCookie(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 Optional<String> header(String headerName)
headerName
- The name of the header (case-insensitive)headerName
, or empty if it was not presentdefault boolean hasHeader(String headerName)
headerName
- The name of the header (case-insensitive)true
if the request did contain the header.boolean hasBody()
Optional<String> contentType()
Optional<String> charset()
Optional<List<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(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(Locale locale)
MessagesApi#preferred(RequestHeader)
}
(It will take precedence over any other language).locale
- The language to use.default Http.RequestHeader withoutTransientLang()
default Optional<Lang> transientLang()
MessagesApi#preferred(RequestHeader)
} (It will take precedence over any other language).play.api.mvc.RequestHeader asScala()
RequestHeader