Transform this call to an absolute URL.
Transform this call to an absolute URL.
Transform this call to an absolute URL.
import play.api.mvc.{ Call, RequestHeader } implicit val req: RequestHeader = myRequest val url: String = Call("GET", "/url").absoluteURL() // == "http://$host/url", or "https://$host/url" if secure
the request HTTP method
the request HTTP method
Transform this call to a URL relative to the current request's path.
Transform this call to a URL relative to the current request's path.
import play.api.mvc.{ Call, RequestHeader } implicit val req: RequestHeader = myRequest // If current req.path == "/playframework" val url: String = Call("GET", "/url").relative // == "../url"
the request URL
the request URL
Transform this call to an WebSocket URL.
Transform this call to an WebSocket URL.
Transform this call to an WebSocket URL.
import play.api.mvc.{ Call, RequestHeader } implicit val req: RequestHeader = myRequest val url: String = Call("GET", "/url").webSocketURL() // == "ws://$host/url", or "wss://$host/url" if secure
Defines a
Call
, which describes an HTTP request and can be used to create links or fill redirect data.These values are usually generated by the reverse router.
the request HTTP method
the request URL