trait HeaderDirectives extends AnyRef
- Grouped
- Alphabetic
- By Inheritance
- HeaderDirectives
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toany2stringadd[HeaderDirectives] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (HeaderDirectives, B)
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toArrowAssoc[HeaderDirectives] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def checkSameOrigin(allowed: Default): Directive0
Checks that request comes from the same origin.
Checks that request comes from the same origin. Extracts the Origin header value and verifies that allowed range contains the obtained value. In the case of absent of the Origin header rejects with MissingHeaderRejection. If the origin value is not in the allowed range rejects with an InvalidOriginRejection and StatusCodes.Forbidden status.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (HeaderDirectives) => Boolean, msg: => Any): HeaderDirectives
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toEnsuring[HeaderDirectives] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (HeaderDirectives) => Boolean): HeaderDirectives
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toEnsuring[HeaderDirectives] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): HeaderDirectives
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toEnsuring[HeaderDirectives] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): HeaderDirectives
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toEnsuring[HeaderDirectives] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def headerValue[T](f: (HttpHeader) => Option[T]): Directive1[T]
Extracts an HTTP header value using the given function.
Extracts an HTTP header value using the given function. If the function result is undefined for all headers the request is rejected with an empty rejection set. If the given function throws an exception the request is rejected with a pekko.http.scaladsl.server.MalformedHeaderRejection.
- def headerValueByName(headerName: String): Directive1[String]
Extracts the value of the HTTP request header with the given name.
Extracts the value of the HTTP request header with the given name. If no header with a matching name is found the request is rejected with a pekko.http.scaladsl.server.MissingHeaderRejection.
- def headerValueByType[T](magnet: HeaderMagnet[T]): Directive1[T]
Extracts the first HTTP request header of the given type.
Extracts the first HTTP request header of the given type. If no header with a matching type is found the request is rejected with a pekko.http.scaladsl.server.MissingHeaderRejection.
Custom headers will only be matched by this directive if they extend ModeledCustomHeader and provide a companion extending ModeledCustomHeaderCompanion.
- def headerValuePF[T](pf: PartialFunction[HttpHeader, T]): Directive1[T]
Extracts an HTTP header value using the given partial function.
Extracts an HTTP header value using the given partial function. If the function is undefined for all headers the request is rejected with an empty rejection set.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def optionalHeaderValue[T](f: (HttpHeader) => Option[T]): Directive1[Option[T]]
Extracts an optional HTTP header value using the given function.
Extracts an optional HTTP header value using the given function. If the given function throws an exception the request is rejected with a pekko.http.scaladsl.server.MalformedHeaderRejection.
- def optionalHeaderValueByName(headerName: String): Directive1[Option[String]]
Extracts the value of the optional HTTP request header with the given name.
- def optionalHeaderValueByType[T <: HttpHeader](magnet: HeaderMagnet[T]): Directive1[Option[T]]
Extract the header value of the optional HTTP request header with the given type.
Extract the header value of the optional HTTP request header with the given type.
Custom headers will only be matched by this directive if they extend ModeledCustomHeader and provide a companion extending ModeledCustomHeaderCompanion.
- def optionalHeaderValuePF[T](pf: PartialFunction[HttpHeader, T]): Directive1[Option[T]]
Extracts an optional HTTP header value using the given partial function.
Extracts an optional HTTP header value using the given partial function. If the given function throws an exception the request is rejected with a pekko.http.scaladsl.server.MalformedHeaderRejection.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toStringFormat[HeaderDirectives] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def headerValueByName(headerName: Symbol): Directive1[String]
Extracts the value of the first HTTP request header with the given name.
Extracts the value of the first HTTP request header with the given name. If no header with a matching name is found the request is rejected with a pekko.http.scaladsl.server.MissingHeaderRejection.
- Annotations
- @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use string argument version or
headerValueByType
, e.g. instead ofheaderValueByName('Referer)
useheaderValueByType(Referer)
- def optionalHeaderValueByName(headerName: Symbol): Directive1[Option[String]]
Extracts the value of the optional HTTP request header with the given name.
Extracts the value of the optional HTTP request header with the given name.
- Annotations
- @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use string argument version or
headerValueByType
, e.g. instead ofoptionalHeaderValueByName('Referer)
useoptionalHeaderValueByType(Referer)
- def →[B](y: B): (HeaderDirectives, B)
- Implicit
- This member is added by an implicit conversion from HeaderDirectives toArrowAssoc[HeaderDirectives] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.