play.mvc
Class Http.Request

java.lang.Object
  extended by play.mvc.Http.Request
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Http

public static class Http.Request
extends java.lang.Object
implements java.io.Serializable

An HTTP Request

See Also:
Serialized Form

Field Summary
 java.lang.String action
          Full action (ex: Application.index)
 java.lang.String actionMethod
          Action method name
 java.util.Map<java.lang.String,java.lang.Object> args
          Free space to store your request specific data
 java.io.InputStream body
          Body stream
 java.lang.String contentType
          Request content-type
 java.lang.String controller
          Controller to invoke
 java.lang.Class<? extends Controller> controllerClass
          The invoked controller class
 java.util.Map<java.lang.String,Http.Cookie> cookies
          HTTP Cookies
static java.lang.ThreadLocal<Http.Request> current
          Bind to thread
 java.util.Date date
          When the request has been received
 java.lang.String domain
          Server domain
 java.lang.String format
          Format (html,xml,json,text)
 java.util.Map<java.lang.String,Http.Header> headers
          HTTP Headers
 java.lang.String host
          Server host
 java.lang.reflect.Method invokedMethod
          The really invoker Java methid
 boolean isLoopback
          Request comes from loopback interface
 boolean isNew
          New request or already submitted
 java.lang.String method
          HTTP method
 Scope.Params params
          Params
 java.lang.String password
          HTTP Basic Password
 java.lang.String path
          Request path
 java.lang.Integer port
          HTTP port
 java.lang.String querystring
          QueryString
 java.lang.String remoteAddress
          Client address
 java.util.Map<java.lang.String,java.lang.String> routeArgs
          Additional HTTP params extracted from route
 java.lang.Boolean secure
          is HTTPS ?
 java.lang.String url
          Full url
 java.lang.String user
          HTTP Basic User
 
Constructor Summary
Http.Request()
           
 
Method Summary
 void _init()
           
 java.util.List<java.lang.String> acceptLanguage()
          Return the languages requested by the browser, ordered by preference (preferred first).
static Http.Request current()
          Retrieve the current request
 java.lang.String getBase()
          Get the request base (ex: http://localhost:9000
 boolean isAjax()
          This request was sent by an Ajax framework.
 boolean isModified(java.lang.String etag, long last)
           
 void resolveFormat()
          Automatically resolve request format from the Accept header (in this order : html > xml > json > text)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

host

public java.lang.String host
Server host


path

public java.lang.String path
Request path


querystring

public java.lang.String querystring
QueryString


url

public java.lang.String url
Full url


method

public java.lang.String method
HTTP method


domain

public java.lang.String domain
Server domain


remoteAddress

public java.lang.String remoteAddress
Client address


contentType

public java.lang.String contentType
Request content-type


controller

public java.lang.String controller
Controller to invoke


actionMethod

public java.lang.String actionMethod
Action method name


port

public java.lang.Integer port
HTTP port


secure

public java.lang.Boolean secure
is HTTPS ?


headers

public java.util.Map<java.lang.String,Http.Header> headers
HTTP Headers


cookies

public java.util.Map<java.lang.String,Http.Cookie> cookies
HTTP Cookies


body

public transient java.io.InputStream body
Body stream


routeArgs

public java.util.Map<java.lang.String,java.lang.String> routeArgs
Additional HTTP params extracted from route


format

public java.lang.String format
Format (html,xml,json,text)


action

public java.lang.String action
Full action (ex: Application.index)


current

public static java.lang.ThreadLocal<Http.Request> current
Bind to thread


invokedMethod

public transient java.lang.reflect.Method invokedMethod
The really invoker Java methid


controllerClass

public transient java.lang.Class<? extends Controller> controllerClass
The invoked controller class


args

public java.util.Map<java.lang.String,java.lang.Object> args
Free space to store your request specific data


date

public java.util.Date date
When the request has been received


isNew

public boolean isNew
New request or already submitted


user

public java.lang.String user
HTTP Basic User


password

public java.lang.String password
HTTP Basic Password


isLoopback

public boolean isLoopback
Request comes from loopback interface


params

public final Scope.Params params
Params

Constructor Detail

Http.Request

public Http.Request()
Method Detail

_init

public void _init()

resolveFormat

public void resolveFormat()
Automatically resolve request format from the Accept header (in this order : html > xml > json > text)


current

public static Http.Request current()
Retrieve the current request

Returns:
the current request

isAjax

public boolean isAjax()
This request was sent by an Ajax framework. (rely on the X-Requested-With header).


getBase

public java.lang.String getBase()
Get the request base (ex: http://localhost:9000

Returns:
the request base of the url (protocol, host and port)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

acceptLanguage

public java.util.List<java.lang.String> acceptLanguage()
Return the languages requested by the browser, ordered by preference (preferred first). If no Accept-Language header is present, an empty list is returned.

Returns:
Language codes in order of preference, e.g. "en-us,en-gb,en,de".

isModified

public boolean isModified(java.lang.String etag,
                          long last)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly