Package play.mvc
Class Http.Request
java.lang.Object
play.mvc.Http.Request
- Enclosing class:
- Http
-
Field Summary
FieldsModifier and TypeFieldDescriptionFull action (ex: Application.index)Free space to store your request specific dataClass<? extends PlayController>
final Date
When the request has been receivedThis is the encoding used to decode this request.Format (html,xml,json,text)boolean
Request comes from loopback interfacefinal Scope.Params
HTTP Basic PasswordAdditional HTTP params extracted from routeURL path (excluding scheme, host and port), starting with '/'
Example:
With this full URLhttp://localhost:9000/path0/path1?foo=bar
=> url will be/path0/path1?foo=bar
HTTP Basic User -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the languages requested by the browser, ordered by preference (preferred first).protected void
static Http.Request
createRequest
(String _remoteAddress, String _method, String _path, String _querystring, String _contentType, InputStream _body, String _url, String _host, boolean _isLoopback, int _port, String _domain, Map<String, Http.Header> _headers, Map<String, Http.Cookie> _cookies) static Http.Request
current()
Deprecated.<T extends Annotation>
TgetActionAnnotation
(Class<T> annotationClass) getBase()
Get the request base (e.g.: http://localhost:9000)boolean
isAjax()
This request was sent by an Ajax framework.boolean
isModified
(String etag, long last) boolean
isSecure()
static void
void
Automatically resolve request format from the Accept header (in this order: html > xml > json > text)void
static void
setCurrent
(Http.Request request) Deprecated.void
toString()
-
Field Details
-
host
-
path
-
querystring
-
url
URL path (excluding scheme, host and port), starting with '/'
Example:
With this full URLhttp://localhost:9000/path0/path1?foo=bar
=> url will be/path0/path1?foo=bar
-
method
-
domain
-
remoteAddress
-
contentType
-
encoding
This is the encoding used to decode this request. If encoding-info is not found in request, then Play.defaultWebEncoding is used -
controller
-
actionMethod
-
port
-
headers
-
cookies
-
body
-
routeArgs
Additional HTTP params extracted from route -
format
Format (html,xml,json,text) -
action
Full action (ex: Application.index) -
invokedMethod
-
controllerClass
-
controllerInstance
-
args
Free space to store your request specific data -
date
When the request has been received -
user
HTTP Basic User -
password
HTTP Basic Password -
isLoopback
public boolean isLoopbackRequest comes from loopback interface -
params
-
cachedIsSecure
-
-
Constructor Details
-
Request
Deprecated.Deprecate the default constructor to encourage the use of createRequest() when creating new requests. Cannot hide it with protected because we have to be backward compatible with modules - ie PlayGrizzlyAdapter.java
-
-
Method Details
-
createRequest
public static Http.Request createRequest(String _remoteAddress, String _method, String _path, String _querystring, String _contentType, InputStream _body, String _url, String _host, boolean _isLoopback, int _port, String _domain, Map<String, Http.Header> _headers, Map<String, Http.Cookie> _cookies) -
isSecure
public boolean isSecure() -
authorizationInit
protected void authorizationInit() -
resolveFormat
public void resolveFormat()Automatically resolve request format from the Accept header (in this order: html > xml > json > text) -
current
Deprecated.Retrieve the current request- Returns:
- the current request
-
setCurrent
Deprecated. -
removeCurrent
public static void removeCurrent() -
isAjax
public boolean isAjax()This request was sent by an Ajax framework. (rely on the X-Requested-With header).- Returns:
- True is the request is an Ajax, false otherwise
-
getUserAgent
-
getBase
Get the request base (e.g.: http://localhost:9000)- Returns:
- the request base of the url (protocol, host and port)
-
toString
-
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
-
setCookie
-
setHeader
-
getActionAnnotation
-