play.mvc
Class Http.RequestHeader

java.lang.Object
  extended by play.mvc.Http.RequestHeader
Direct Known Subclasses:
Http.Request
Enclosing class:
Http

public abstract static class Http.RequestHeader
extends java.lang.Object


Constructor Summary
Http.RequestHeader()
           
 
Method Summary
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.
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  java.lang.String uri()
          The complete request URI, containing both path and query string.
abstract  java.lang.String version()
          The HTTP version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Http.RequestHeader

public Http.RequestHeader()
Method Detail

uri

public abstract java.lang.String uri()
The complete request URI, containing both path and query string.


method

public abstract java.lang.String method()
The HTTP Method.


version

public abstract java.lang.String version()
The HTTP version.


remoteAddress

public abstract java.lang.String remoteAddress()
The client IP address. If the 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.


host

public abstract java.lang.String host()
The request host.


path

public abstract java.lang.String path()
The URI path.


acceptLanguages

public abstract java.util.List<Lang> acceptLanguages()
The Request Langs extracted from the Accept-Language header and sorted by preference (preferred first).


accept

@Deprecated
public abstract java.util.List<java.lang.String> accept()
Deprecated. Use acceptedTypes() instead.

Returns:
The media types set in the request Accept header, not sorted in any particular order.

acceptedTypes

public abstract java.util.List<play.api.http.MediaRange> acceptedTypes()
Returns:
The media types set in the request Accept header, sorted by preference (preferred first).

accepts

public abstract boolean accepts(java.lang.String mimeType)
Check if this request accepts a given media type.

Returns:
true if mimeType is in the Accept header, otherwise false

queryString

public abstract java.util.Map<java.lang.String,java.lang.String[]> queryString()
The query string content.


getQueryString

public java.lang.String getQueryString(java.lang.String key)
Helper method to access a queryString parameter.


cookies

public abstract Http.Cookies cookies()
Returns:
the request cookies

cookie

public Http.Cookie cookie(java.lang.String name)
Parameters:
name - Name of the cookie to retrieve
Returns:
the cookie, if found, otherwise null.

headers

public abstract java.util.Map<java.lang.String,java.lang.String[]> headers()
Retrieves all headers.

Returns:
headers

getHeader

public java.lang.String getHeader(java.lang.String headerName)
Retrieves a single header.