public interface HeaderDirectives
| Modifier and Type | Method and Description |
|---|---|
Directive<scala.runtime.BoxedUnit> |
checkSameOrigin(HttpOriginRange.Default allowed)
Checks that request comes from the same origin.
|
<T> Directive<scala.Tuple1<T>> |
headerValue(scala.Function1<HttpHeader,scala.Option<T>> f)
Extracts an HTTP header value using the given function.
|
Directive<scala.Tuple1<java.lang.String>> |
headerValueByName(java.lang.String headerName)
Extracts the value of the HTTP request header with the given name.
|
Directive<scala.Tuple1<java.lang.String>> |
headerValueByName(scala.Symbol headerName)
Deprecated.
Use string argument version or `headerValueByType`, e.g. instead of `headerValueByName('Referer)` use `headerValueByType(Referer)`. Since Akka HTTP 10.2.0.
|
<T> Directive<scala.Tuple1<T>> |
headerValueByType(HeaderMagnet<T> magnet)
Extracts the first HTTP request header of the given type.
|
<T> Directive<scala.Tuple1<T>> |
headerValuePF(scala.PartialFunction<HttpHeader,T> pf)
Extracts an HTTP header value using the given partial function.
|
<T> Directive<scala.Tuple1<scala.Option<T>>> |
optionalHeaderValue(scala.Function1<HttpHeader,scala.Option<T>> f)
Extracts an optional HTTP header value using the given function.
|
Directive<scala.Tuple1<scala.Option<java.lang.String>>> |
optionalHeaderValueByName(java.lang.String headerName)
Extracts the value of the optional HTTP request header with the given name.
|
Directive<scala.Tuple1<scala.Option<java.lang.String>>> |
optionalHeaderValueByName(scala.Symbol headerName)
Deprecated.
Use string argument version or `headerValueByType`, e.g. instead of `optionalHeaderValueByName('Referer)` use `optionalHeaderValueByType(Referer)`. Since Akka HTTP 10.2.0.
|
<T extends HttpHeader> |
optionalHeaderValueByType(HeaderMagnet<T> magnet)
Extract the header value of the optional HTTP request header with the given type.
|
<T> Directive<scala.Tuple1<scala.Option<T>>> |
optionalHeaderValuePF(scala.PartialFunction<HttpHeader,T> pf)
Extracts an optional HTTP header value using the given partial function.
|
scala.Function1<HttpHeader,scala.Option<java.lang.String>> |
optionalValue(java.lang.String lowerCaseName) |
Directive<scala.runtime.BoxedUnit> checkSameOrigin(HttpOriginRange.Default allowed)
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.
allowed - (undocumented)<T> Directive<scala.Tuple1<T>> headerValue(scala.Function1<HttpHeader,scala.Option<T>> f)
pekko.http.scaladsl.server.MalformedHeaderRejection.
f - (undocumented)<T> Directive<scala.Tuple1<T>> headerValuePF(scala.PartialFunction<HttpHeader,T> pf)
pf - (undocumented)Directive<scala.Tuple1<java.lang.String>> headerValueByName(scala.Symbol headerName)
pekko.http.scaladsl.server.MissingHeaderRejection.
headerName - (undocumented)Directive<scala.Tuple1<java.lang.String>> headerValueByName(java.lang.String headerName)
pekko.http.scaladsl.server.MissingHeaderRejection.
headerName - (undocumented)<T> Directive<scala.Tuple1<T>> headerValueByType(HeaderMagnet<T> magnet)
pekko.http.scaladsl.server.MissingHeaderRejection.
Custom headers will only be matched by this directive if they extend ModeledCustomHeader
and provide a companion extending ModeledCustomHeaderCompanion.
magnet - (undocumented)<T> Directive<scala.Tuple1<scala.Option<T>>> optionalHeaderValue(scala.Function1<HttpHeader,scala.Option<T>> f)
pekko.http.scaladsl.server.MalformedHeaderRejection.
f - (undocumented)<T> Directive<scala.Tuple1<scala.Option<T>>> optionalHeaderValuePF(scala.PartialFunction<HttpHeader,T> pf)
pekko.http.scaladsl.server.MalformedHeaderRejection.
pf - (undocumented)Directive<scala.Tuple1<scala.Option<java.lang.String>>> optionalHeaderValueByName(scala.Symbol headerName)
headerName - (undocumented)Directive<scala.Tuple1<scala.Option<java.lang.String>>> optionalHeaderValueByName(java.lang.String headerName)
headerName - (undocumented)<T extends HttpHeader> Directive<scala.Tuple1<scala.Option<T>>> optionalHeaderValueByType(HeaderMagnet<T> magnet)
Custom headers will only be matched by this directive if they extend ModeledCustomHeader
and provide a companion extending ModeledCustomHeaderCompanion.
magnet - (undocumented)scala.Function1<HttpHeader,scala.Option<java.lang.String>> optionalValue(java.lang.String lowerCaseName)