trait RouteDirectives extends AnyRef
- Grouped
- Alphabetic
- By Inheritance
- RouteDirectives
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Route directives
- def complete[T](status: StatusCode, headers: Seq[HttpHeader], v: => T)(implicit m: ToEntityMarshaller[T]): StandardRoute
Completes the request using the given arguments.
- def complete[T](status: StatusCode, v: => T)(implicit m: ToEntityMarshaller[T]): StandardRoute
Completes the request using the given arguments.
- def complete(m: => ToResponseMarshallable): StandardRoute
Completes the request using the given arguments.
- def failWith(error: Throwable): StandardRoute
Bubbles the given error up the response chain, where it is dealt with by the closest
handleExceptions
directive and its ExceptionHandler. - def handle(handler: PartialFunction[HttpRequest, Future[HttpResponse]], rejections: Seq[Rejection]): StandardRoute
Handle the request using an asynchronous partial function.
Handle the request using an asynchronous partial function.
This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- rejections
The list of rejections to reject with if the handler is not defined for a request.
- def handle(handler: PartialFunction[HttpRequest, Future[HttpResponse]]): StandardRoute
Handle the request using an asynchronous partial function.
Handle the request using an asynchronous partial function.
This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- def handle(handler: (HttpRequest) => Future[HttpResponse]): StandardRoute
Handle the request using a function.
- def handleSync(handler: PartialFunction[HttpRequest, HttpResponse], rejections: Seq[Rejection]): StandardRoute
Handle the request using a synchronous partial function.
Handle the request using a synchronous partial function.
This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- rejections
The list of rejections to reject with if the handler is not defined for a request.
- def handleSync(handler: PartialFunction[HttpRequest, HttpResponse]): StandardRoute
Handle the request using a synchronous partial function.
Handle the request using a synchronous partial function.
This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- def handleSync(handler: (HttpRequest) => HttpResponse): StandardRoute
Handle the request using a function.
- def redirect(uri: Uri, redirectionType: Redirection): StandardRoute
Completes the request with redirection response of the given type to the given URI.
- def reject(rejections: Rejection*): StandardRoute
Rejects the request with the given rejections.
- def reject: StandardRoute
Rejects the request with an empty set of rejections.