Interface MiscDirectives
- All Known Subinterfaces:
- Directives
- All Known Implementing Classes:
- Directives$,- HttpApp,- MiscDirectives$
public interface MiscDirectives
- 
Method SummaryModifier and TypeMethodDescriptionDirective<scala.Tuple1<RemoteAddress>>Extracts the client's IP from either the X-Forwarded-For, Remote-Address, X-Real-IP header orpekko.http.scaladsl.model.AttributeKeys.remoteAddressattribute (in that order of priority).Directive<scala.runtime.BoxedUnit>Converts responses with an empty entity into (empty) rejections.Directive<scala.runtime.BoxedUnit>Rejects if the request entity is non-empty.Directive<scala.runtime.BoxedUnit>Rejects with aRequestEntityExpectedRejectionif the request entity is empty.selectPreferredLanguage(Language first, scala.collection.immutable.Seq<Language> more) Inspects the request'sAccept-Languageheader and determines, which of the given language alternatives is preferred by the client.Directive<scala.runtime.BoxedUnit>Checks the given condition before running its inner route.Directive<scala.runtime.BoxedUnit>Disables the size limit (configured bypekko.http.parsing.max-content-lengthby default) checking on the incomingHttpRequestentity.Directive<scala.runtime.BoxedUnit>withSizeLimit(long maxBytes) Fails the stream withpekko.http.scaladsl.model.EntityStreamSizeExceptionif its request entity size exceeds given limit.
- 
Method Details- 
validateChecks the given condition before running its inner route. If the condition fails the route is rejected with aValidationRejection.- Parameters:
- check- (undocumented)
- errorMsg- (undocumented)
- Returns:
- (undocumented)
 
- 
extractClientIPDirective<scala.Tuple1<RemoteAddress>> extractClientIP()Extracts the client's IP from either the X-Forwarded-For, Remote-Address, X-Real-IP header orpekko.http.scaladsl.model.AttributeKeys.remoteAddressattribute (in that order of priority).- Returns:
- (undocumented)
 
- 
requestEntityEmptyDirective<scala.runtime.BoxedUnit> requestEntityEmpty()Rejects if the request entity is non-empty.- Returns:
- (undocumented)
 
- 
requestEntityPresentDirective<scala.runtime.BoxedUnit> requestEntityPresent()Rejects with aRequestEntityExpectedRejectionif the request entity is empty. Non-empty requests are passed on unchanged to the inner route.- Returns:
- (undocumented)
 
- 
rejectEmptyResponseDirective<scala.runtime.BoxedUnit> rejectEmptyResponse()Converts responses with an empty entity into (empty) rejections. This way you can, for example, have the marshalling of a ''None'' option be treated as if the request could not be matched.- Returns:
- (undocumented)
 
- 
selectPreferredLanguageDirective<scala.Tuple1<Language>> selectPreferredLanguage(Language first, scala.collection.immutable.Seq<Language> more) Inspects the request'sAccept-Languageheader and determines, which of the given language alternatives is preferred by the client. (See http://tools.ietf.org/html/rfc7231#section-5.3.5 for more details on the negotiation logic.) If there are several best language alternatives that the client has equal preference for (even if this preference is zero!) the order of the arguments is used as a tie breaker (First one wins).- Parameters:
- first- (undocumented)
- more- (undocumented)
- Returns:
- (undocumented)
 
- 
withSizeLimitFails the stream withpekko.http.scaladsl.model.EntityStreamSizeExceptionif its request entity size exceeds given limit. Limit given as parameter overrides limit configured withpekko.http.parsing.max-content-length.Beware that request entity size check is executed when entity is consumed. - Parameters:
- maxBytes- (undocumented)
- Returns:
- (undocumented)
 
- 
withoutSizeLimitDirective<scala.runtime.BoxedUnit> withoutSizeLimit()Disables the size limit (configured bypekko.http.parsing.max-content-lengthby default) checking on the incomingHttpRequestentity. Can be useful when handling arbitrarily large data uploads in specific parts of your routes.- Returns:
- (undocumented)
 
 
-