api

http4k / org.http4k.filter

Package org.http4k.filter

This is the base package for all Filter implementations.

Types

Name Summary
CacheControlHeaderPart open class CacheControlHeaderPart
CachingFilters object CachingFilters
Useful filters for applying Cache-Controls to request/responses
CanonicalPayload data class CanonicalPayload
ClientFilters object ClientFilters
CorsPolicy data class CorsPolicy
DebuggingFilters object DebuggingFilters
DefaultCacheTimings data class DefaultCacheTimings
GenerateDataClasses class GenerateDataClasses<out NODE> : Filter
This Filter is used to generate Data class definitions from a Response containing JSON. The Filter will try and reduce the number of class definitions by selecting the definition with the most fields (for cases where lists of items have different fields).
GenerateXmlDataClasses class GenerateXmlDataClasses<NODE : Any> : Filter
This Filter is used to generate Data class definitions from a Response containing XML. The Filter will try and reduce the number of class definitions by selecting the definition with the most fields (for cases where lists of items have different fields).
GsonGenerateXmlDataClasses object GsonGenerateXmlDataClasses
Provides an implementation of GenerateXmlDataClasses using GSON as an engine.
JacksonXmlGenerateXmlDataClasses object JacksonXmlGenerateXmlDataClasses
Provides an implementation of GenerateXmlDataClasses using GSON as an engine.
MaxAgeTtl data class MaxAgeTtl : CacheControlHeaderPart
MetricFilters object MetricFilters
Payload object Payload
RequestFilters object RequestFilters
ResilienceFilters object ResilienceFilters
ResponseFilters object ResponseFilters
SamplingDecision data class SamplingDecision
ServerFilters object ServerFilters
StaleIfErrorTtl data class StaleIfErrorTtl : CacheControlHeaderPart
StaleWhenRevalidateTtl data class StaleWhenRevalidateTtl : CacheControlHeaderPart
TraceId data class TraceId
TrafficFilters object TrafficFilters
ZipkinTraces data class ZipkinTraces

Type Aliases

Name Summary
HttpTransactionLabeller typealias HttpTransactionLabeller = (HttpTransaction) -> HttpTransaction

Functions

Name Summary
AwsAuth fun ClientFilters.AwsAuth(scope: AwsCredentialScope, credentials: AwsCredentials, clock: Clock = Clock.systemDefaultZone(), payloadMode: Payload.Mode = Payload.Mode.Signed): Filter
Sign AWS requests using static credentials.fun ClientFilters.AwsAuth(scope: AwsCredentialScope, credentialsProvider: () -> AwsCredentials, clock: Clock = Clock.systemDefaultZone(), payloadMode: Payload.Mode = Payload.Mode.Signed): Filter
Sign AWS requests using dynamically provided (expiring) credentials.
gunzipped fun Body.gunzipped(): Body
gzipped fun Body.gzipped(): Body
HandleUpstreamRequestFailed fun ServerFilters.HandleUpstreamRequestFailed(exceptionToBody: UpstreamRequestFailed.() -> String = { localizedMessage }): Filter
Handle exceptions from upstream calls and convert them into sensible server-side errors. Optionally pass in a function to format the response body from the exception.fun ClientFilters.HandleUpstreamRequestFailed(responseWasSuccessful: Response.() -> Boolean = { status.successful }, responseToMessage: Response.() -> String = Response::bodyString): Filter
Convert upstream errors from upstream into exceptions which can be handled at a higher level. Optionally pass in:
ProcessFiles fun ServerFilters.ProcessFiles(fileConsumer: (MultipartEntity.File) -> String): Filter
Process files on upload using the passed consumer, which returns a reference. The form file is replaced in the form with this reference.