Interface HeaderDirectives
- All Known Subinterfaces:
- Directives
- All Known Implementing Classes:
- Directives$,- HeaderDirectives$,- HttpApp
public interface HeaderDirectives
- 
Method SummaryModifier and TypeMethodDescriptionDirective<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.headerValueByName(String headerName) Extracts the value of the HTTP request header with the given name.<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.optionalHeaderValueByName(String headerName) Extracts the value of the optional HTTP request header with the given name.<T extends HttpHeader>
 Directive<scala.Tuple1<scala.Option<T>>>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<String>> optionalValue(String lowerCaseName) 
- 
Method Details- 
checkSameOriginChecks that request comes from the same origin. Extracts theOriginheader value and verifies that allowed range contains the obtained value. In the case of absent of theOriginheader rejects withMissingHeaderRejection. If the origin value is not in the allowed range rejects with anInvalidOriginRejectionandStatusCodes.Forbiddenstatus.- Parameters:
- allowed- (undocumented)
- Returns:
- (undocumented)
 
- 
headerValueExtracts 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 apekko.http.scaladsl.server.MalformedHeaderRejection.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
headerValuePFExtracts 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.- Parameters:
- pf- (undocumented)
- Returns:
- (undocumented)
 
- 
headerValueByNameExtracts 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 apekko.http.scaladsl.server.MissingHeaderRejection.- Parameters:
- headerName- (undocumented)
- Returns:
- (undocumented)
 
- 
headerValueByTypeExtracts the first HTTP request header of the given type. If no header with a matching type is found the request is rejected with apekko.http.scaladsl.server.MissingHeaderRejection.Custom headers will only be matched by this directive if they extend ModeledCustomHeaderand provide a companion extendingModeledCustomHeaderCompanion.- Parameters:
- magnet- (undocumented)
- Returns:
- (undocumented)
 
- 
optionalHeaderValue<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. If the given function throws an exception the request is rejected with apekko.http.scaladsl.server.MalformedHeaderRejection.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
optionalHeaderValuePF<T> Directive<scala.Tuple1<scala.Option<T>>> optionalHeaderValuePF(scala.PartialFunction<HttpHeader, T> pf) Extracts an optional HTTP header value using the given partial function. If the given function throws an exception the request is rejected with apekko.http.scaladsl.server.MalformedHeaderRejection.- Parameters:
- pf- (undocumented)
- Returns:
- (undocumented)
 
- 
optionalHeaderValueByNameExtracts the value of the optional HTTP request header with the given name.- Parameters:
- headerName- (undocumented)
- Returns:
- (undocumented)
 
- 
optionalHeaderValueByType<T extends HttpHeader> Directive<scala.Tuple1<scala.Option<T>>> optionalHeaderValueByType(HeaderMagnet<T> magnet) 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 ModeledCustomHeaderand provide a companion extendingModeledCustomHeaderCompanion.- Parameters:
- magnet- (undocumented)
- Returns:
- (undocumented)
 
- 
optionalValue
 
-