pass

Signature

def pass: Directive0

Description

A directive that passes the request unchanged to its inner route.

It is usually used as a “neutral element” when combining directives generically.

Example

Scala
val route = pass(complete("abc"))

// tests:
Get("/") ~> route ~> check {
  responseAs[String] shouldEqual "abc"
}
Java
import static akka.http.javadsl.server.Directives.pass;

final Route route = pass(() -> complete("abc"));

// tests:
testRoute(route).run(HttpRequest.GET("/"))
  .assertEntity("abc");
Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.