public abstract static class Http.RequestHeader
extends java.lang.Object
Constructor and Description |
---|
Http.RequestHeader() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<java.lang.String> |
accept()
Deprecated.
Use
acceptedTypes() instead. |
abstract java.util.List<play.api.http.MediaRange> |
acceptedTypes() |
abstract java.util.List<Lang> |
acceptLanguages()
The Request Langs extracted from the Accept-Language header and sorted by preference (preferred first).
|
abstract boolean |
accepts(java.lang.String mimeType)
Check if this request accepts a given media type.
|
Http.Cookie |
cookie(java.lang.String name) |
abstract Http.Cookies |
cookies() |
java.lang.String |
getHeader(java.lang.String headerName)
Retrieves a single header.
|
java.lang.String |
getQueryString(java.lang.String key)
Helper method to access a queryString parameter.
|
boolean |
hasHeader(java.lang.String headerName)
Checks if the request has the header.
|
abstract java.util.Map<java.lang.String,java.lang.String[]> |
headers()
Retrieves all headers.
|
abstract java.lang.String |
host()
The request host.
|
abstract java.lang.String |
method()
The HTTP Method.
|
abstract java.lang.String |
path()
The URI path.
|
abstract java.util.Map<java.lang.String,java.lang.String[]> |
queryString()
The query string content.
|
abstract java.lang.String |
remoteAddress()
The client IP address.
|
abstract boolean |
secure()
Is the client using SSL?
If the
X-Forwarded-Proto header is present, then this method will return true
if the value in that header is "https", if either the local address is 127.0.0.1, or if
trustxforwarded is configured to be true in the application configuration file. |
abstract java.lang.String |
uri()
The complete request URI, containing both path and query string.
|
abstract java.lang.String |
version()
The HTTP version.
|
public abstract java.lang.String uri()
public abstract java.lang.String method()
public abstract java.lang.String version()
public abstract java.lang.String remoteAddress()
X-Forwarded-For
header is present, then this method will return the value in that header
if either the local address is 127.0.0.1, or if trustxforwarded
is configured to be true in the
application configuration file.public abstract boolean secure()
X-Forwarded-Proto
header is present, then this method will return true
if the value in that header is "https", if either the local address is 127.0.0.1, or if
trustxforwarded
is configured to be true in the application configuration file.public abstract java.lang.String host()
public abstract java.lang.String path()
public abstract java.util.List<Lang> acceptLanguages()
@Deprecated public abstract java.util.List<java.lang.String> accept()
acceptedTypes()
instead.public abstract java.util.List<play.api.http.MediaRange> acceptedTypes()
public abstract boolean accepts(java.lang.String mimeType)
mimeType
is in the Accept header, otherwise falsepublic abstract java.util.Map<java.lang.String,java.lang.String[]> queryString()
public java.lang.String getQueryString(java.lang.String key)
public abstract Http.Cookies cookies()
public Http.Cookie cookie(java.lang.String name)
name
- Name of the cookie to retrievepublic abstract java.util.Map<java.lang.String,java.lang.String[]> headers()
public java.lang.String getHeader(java.lang.String headerName)
headerName
- The name of the header (case-insensitive).public boolean hasHeader(java.lang.String headerName)
headerName
- The name of the header (case-insensitive).