Extracts the complete HttpRequest instance.


def requestInstance: Directive1[HttpRequest] 


Use requestUri to extract just the complete URI of the request. Usually there’s little use of extracting the complete request because extracting of most of the aspects of HttpRequests is handled by specialized directives. See Directives filtering or extracting from the request.


val route =
  requestInstance { request =>
    complete(s"Request method is ${request.method} and length is ${}")

Post("/", "text") ~> route ~> check {
  responseAs[String] === "Request method is POST and length is 4"
Get("/") ~> route ~> check {
  responseAs[String] === "Request method is GET and length is 0"