BasicDirectives

org.apache.pekko.http.scaladsl.server.directives.BasicDirectives
See theBasicDirectives companion object

Attributes

Companion
object
Source
BasicDirectives.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Directives
object Directives
class HttpApp

Members list

Grouped members

Basic directives

Adds a TransformationRejection cancelling all rejections equal to the given one to the list of rejections potentially coming back from the inner route.

Adds a TransformationRejection cancelling all rejections equal to the given one to the list of rejections potentially coming back from the inner route.

Attributes

Source
BasicDirectives.scala
def cancelRejections(classes: Class[_]*): Directive0

Adds a TransformationRejection cancelling all rejections of one of the given classes to the list of rejections potentially coming back from the inner route.

Adds a TransformationRejection cancelling all rejections of one of the given classes to the list of rejections potentially coming back from the inner route.

Attributes

Source
BasicDirectives.scala
def cancelRejections(cancelFilter: Rejection => Boolean): Directive0

Adds a TransformationRejection cancelling all rejections for which the given filter function returns true to the list of rejections potentially coming back from the inner route.

Adds a TransformationRejection cancelling all rejections for which the given filter function returns true to the list of rejections potentially coming back from the inner route.

Attributes

Source
BasicDirectives.scala
def extract[T](f: RequestContext => T): Directive1[T]

Extracts a single value using the given function.

Extracts a single value using the given function.

Attributes

Source
BasicDirectives.scala

Extracts the pekko.actor.ActorSystem if the available Materializer is an pekko.stream.ActorMaterializer. Otherwise throws an exception as it won't be able to extract the system from arbitrary materializers.

Extracts the pekko.actor.ActorSystem if the available Materializer is an pekko.stream.ActorMaterializer. Otherwise throws an exception as it won't be able to extract the system from arbitrary materializers.

Attributes

Source
BasicDirectives.scala

Extracts the already matched path from the RequestContext.

Extracts the already matched path from the RequestContext.

Attributes

Source
BasicDirectives.scala

Extracts the current HttpRequest instance.

Extracts the current HttpRequest instance.

Attributes

Source
BasicDirectives.scala

Extracts the RoutingSettings from the pekko.http.scaladsl.server.RequestContext.

Extracts the RoutingSettings from the pekko.http.scaladsl.server.RequestContext.

Attributes

Source
BasicDirectives.scala

WARNING: This will read the entire request entity into memory and effectively disable streaming.

WARNING: This will read the entire request entity into memory and effectively disable streaming.

To help protect against excessive memory use, the request will be aborted if the request is larger than allowed by the pekko.http.parsing.max-to-strict-bytes configuration setting.

Converts the HttpEntity from the pekko.http.scaladsl.server.RequestContext into an pekko.http.scaladsl.model.HttpEntity.Strict and extracts it, or fails the route if unable to drain the entire request body within the timeout.

Value parameters

timeout

The directive is failed if the stream isn't completed after the given timeout.

Attributes

Source
BasicDirectives.scala

WARNING: This will read the entire request entity into memory and effectively disable streaming.

WARNING: This will read the entire request entity into memory and effectively disable streaming.

To help protect against excessive memory use, the request will be aborted if the request is larger than allowed by the pekko.http.parsing.max-to-strict-bytes configuration setting.

Converts the HttpEntity from the pekko.http.scaladsl.server.RequestContext into an pekko.http.scaladsl.model.HttpEntity.Strict and extracts it, or fails the route if unable to drain the entire request body within the timeout.

Value parameters

timeout

The directive is failed if the stream isn't completed after the given timeout.

Attributes

Source
BasicDirectives.scala

Extracts the yet unmatched path from the RequestContext.

Extracts the yet unmatched path from the RequestContext.

Attributes

Source
BasicDirectives.scala

Extracts the complete request URI.

Extracts the complete request URI.

Attributes

Source
BasicDirectives.scala

Attributes

Source
BasicDirectives.scala

Runs the inner route with settings mapped by the given function.

Runs the inner route with settings mapped by the given function.

Attributes

Source
BasicDirectives.scala

Transforms the unmatchedPath of the RequestContext using the given function.

Transforms the unmatchedPath of the RequestContext using the given function.

Attributes

Source
BasicDirectives.scala

A Directive0 that always passes the request on to its inner route (i.e. does nothing with the request or the response).

A Directive0 that always passes the request on to its inner route (i.e. does nothing with the request or the response).

Attributes

Source
BasicDirectives.scala
def provide[T](value: T): Directive1[T]

Injects the given value into a directive.

Injects the given value into a directive.

Attributes

Source
BasicDirectives.scala
def textract[L : Tuple](f: RequestContext => L): Directive[L]

Extracts a number of values using the given function.

Extracts a number of values using the given function.

Attributes

Source
BasicDirectives.scala

WARNING: This will read the entire request entity into memory and effectively disable streaming.

WARNING: This will read the entire request entity into memory and effectively disable streaming.

To help protect against excessive memory use, the request will be aborted if the request is larger than allowed by the pekko.http.parsing.max-to-strict-bytes configuration setting.

Extracts the pekko.http.scaladsl.server.RequestContext itself with the strict HTTP entity, or fails the route if unable to drain the entire request body within the timeout.

Value parameters

timeout

The directive is failed if the stream isn't completed after the given timeout.

Attributes

Source
BasicDirectives.scala
def toStrictEntity(timeout: FiniteDuration, maxBytes: Long): Directive0

WARNING: This will read the entire request entity into memory and effectively disable streaming.

WARNING: This will read the entire request entity into memory and effectively disable streaming.

To help protect against excessive memory use, the request will be aborted if the request is larger than allowed by the pekko.http.parsing.max-to-strict-bytes configuration setting.

Extracts the pekko.http.scaladsl.server.RequestContext itself with the strict HTTP entity, or fails the route if unable to drain the entire request body within the timeout.

Value parameters

timeout

The directive is failed if the stream isn't completed after the given timeout.

Attributes

Source
BasicDirectives.scala
def tprovide[L : Tuple](values: L): Directive[L]

Injects the given values into a directive.

Injects the given values into a directive.

Attributes

Source
BasicDirectives.scala

Runs its inner route with the given alternative scala.concurrent.ExecutionContextExecutor.

Runs its inner route with the given alternative scala.concurrent.ExecutionContextExecutor.

Attributes

Source
BasicDirectives.scala

Runs its inner route with the given alternative pekko.event.LoggingAdapter.

Runs its inner route with the given alternative pekko.event.LoggingAdapter.

Attributes

Source
BasicDirectives.scala

Runs its inner route with the given alternative pekko.stream.Materializer.

Runs its inner route with the given alternative pekko.stream.Materializer.

Attributes

Source
BasicDirectives.scala

Runs its inner route with the given alternative RoutingSettings.

Runs its inner route with the given alternative RoutingSettings.

Attributes

Source
BasicDirectives.scala