Package play.mvc
Class Call
java.lang.Object
play.mvc.Call
Defines a 'call', describing an HTTP request. For example used to create links or populate
redirect data.
These values are usually generated by the reverse router.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabsoluteURL(boolean secure, String host) Transform this call to an absolute URL.absoluteURL(Http.Request request) Transform this call to an absolute URL.absoluteURL(Http.Request request, boolean secure) Transform this call to an absolute URL.protected StringReturns the fragment (including the leading "#") if this call has one.Transform this path into its canonical form.abstract Stringfragment()The fragment of the URL.abstract Stringmethod()The request HTTP method.path()relativeTo(String startPath) Transform this call to a relative path.relativeTo(Http.RequestHeader requestHeader) Transform this call to a relative path.toString()unique()Append a unique identifier to the URL.protected final Stringabstract Stringurl()The request URL.webSocketURL(boolean secure, String host) Transform this call to an WebSocket URL.webSocketURL(Http.Request request) Transform this call to an WebSocket URL.webSocketURL(Http.Request request, boolean secure) Transform this call to an WebSocket URL.withFragment(String fragment) Returns a new Call with the given fragment.
-
Constructor Details
-
Call
public Call()
-
-
Method Details
-
url
The request URL.- Returns:
- the url
-
method
The request HTTP method.- Returns:
- the http method (e.g. "GET")
-
fragment
The fragment of the URL.- Returns:
- the fragment (without leading '#' character)
-
unique
Append a unique identifier to the URL.- Returns:
- a copy if this call with a unique identifier to this url
-
uniquify
-
withFragment
Returns a new Call with the given fragment.- Parameters:
fragment- the URL fragment- Returns:
- a copy of this call that contains the fragment
-
appendFragment
Returns the fragment (including the leading "#") if this call has one.- Returns:
- the fragment, with leading "#"
-
absoluteURL
Transform this call to an absolute URL.- Parameters:
request- used to identify the host and protocol that should base this absolute URL- Returns:
- the absolute URL string
-
absoluteURL
Transform this call to an absolute URL.- Parameters:
request- used to identify the host that should base this absolute URLsecure- true if the absolute URL should use HTTPS protocol- Returns:
- the absolute URL string
-
absoluteURL
Transform this call to an absolute URL.- Parameters:
secure- true if the absolute URL should use HTTPS protocol instead of HTTPhost- the absolute URL's domain- Returns:
- the absolute URL string
-
webSocketURL
Transform this call to an WebSocket URL.- Parameters:
request- used as the base for forming the WS url- Returns:
- the websocket url string
-
webSocketURL
Transform this call to an WebSocket URL.- Parameters:
request- used to identify the host for the absolute URLsecure- true if it should be a wss rather than ws URL- Returns:
- the websocket URL string
-
webSocketURL
Transform this call to an WebSocket URL.- Parameters:
host- the host for the absolute URL.secure- true if it should be a wss rather than ws URL- Returns:
- the url string
-
relativeTo
Transform this call to a relative path.- Parameters:
requestHeader- used to identify the current URL to make this Call relative to.- Returns:
- the relative path string
-
relativeTo
Transform this call to a relative path.- Parameters:
startPath- the URL to make this Call relative to.- Returns:
- the relative path string
-
canonical
Transform this path into its canonical form.- Returns:
- the canonical path.
-
path
-
toString
-