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)@Nullable StringFree space to store your request specific dataClass<? extends PlayController>final DateWhen the request has been receivedThis is the encoding used to decode this request.Format (html,xml,json,text)booleanRequest comes from loop-back interfacefinal @NonNull Scope.ParamsHTTP 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=barHTTP Basic User -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the languages requested by the browser, ordered by preference (preferred first).protected voidstatic Http.RequestcreateRequest(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.Requestcurrent()Deprecated.<T extends Annotation>
TgetActionAnnotation(Class<T> annotationClass) @NonNull StringgetBase()Get the request base (e.g.: http://localhost:9000)@Nullable StringbooleanisAjax()This request was sent by an Ajax framework.booleanisModified(String eTag, long last) booleanisSecure()static voidvoidAutomatically resolve request format from the Accept header (in this order: html > xml > json > text)voidstatic voidsetCurrent(Http.Request request) Deprecated.voidtoString()
-
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 loop-back 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
-