play.mvc
Class Http.Request

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

public static class Http.Request
extends Object
implements Serializable

An HTTP Request

See Also:
Serialized Form

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

Field Detail

host

public String host
Server host


path

public String path
Request path


querystring

public String querystring
QueryString


url

public String url
Full url


method

public String method
HTTP method


domain

public String domain
Server domain


remoteAddress

public String remoteAddress
Client address


contentType

public String contentType
Request content-type


controller

public String controller
Controller to invoke


actionMethod

public String actionMethod
Action method name


port

public Integer port
HTTP port


secure

public Boolean secure
is HTTPS ?


headers

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


cookies

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


body

public transient InputStream body
Body stream


routeArgs

public Map<String,String> routeArgs
Additinal HTTP params extracted from route


format

public String format
Format (html,xml,json,text)


action

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


current

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


invokedMethod

public transient Method invokedMethod
The really invoker Java methid


args

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


date

public Date date
When the request has been received


isNew

public boolean isNew
New request or already submitted


user

public String user
HTTP Basic User


password

public String password
HTTP Basic Password


isLoopback

public boolean isLoopback
Request comes from loopback interface

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 String getBase()
Get the request base (ex: http://localhost:9000

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

toString

public String toString()
Overrides:
toString in class Object

acceptLanguage

public List<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.


isModified

public boolean isModified(String etag,
                          long last)


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