requestUri
Access the full URI of the request.
Signature
def requestUri: Directive1[Uri]
Description
Use SchemeDirectives, HostDirectives, PathDirectives, and ParameterDirectives for more targeted access to parts of the URI.
Example
val route =
requestUri { uri =>
complete(s"Full URI: $uri")
}
Get("/") ~> route ~> check {
// tests are executed with the host assumed to be "example.com"
responseAs[String] === "Full URI: http://example.com/"
}
Get("/test") ~> route ~> check {
responseAs[String] === "Full URI: http://example.com/test"
}