Recording/replaying HTTP traffic
A set of classes to provide simple recording/replaying of HTTP traffic. This is perfect for testing purposes, or in short lived, low traffic environments where no proper caches are available.
compile group: "org.http4k", name: "http4k-core", version: "3.226.0"
Caching HTTP Traffic
Filters it's possible to record traffic and then return recorded content instead of making repeated calls. Note that the provided storage
implementations DO NOT have any facility for Cache Control or eviction, or respect any response headers around caching. Requests are indexed in a way optimised for retrieval.
Recording Streams of HTTP Traffic
Filters it's possible to record a stream traffic and then replay recorded content instead. Requests are indexed in a way optimised for iteration.
org.http4k.traffic package contains the interfaces which make up the core concepts for traffic capture and replay. These interfaces are:
Sinkconsumes request/response pairs for storage.
Sourceprovides lookup of pre-stored Response based on an HTTP Request.
Replayinstances provide streams of HTTP messages as they were received.
Sourceto provide cache-like storage.
Replayto provide a stream of traffic which can be replayed.
The API has been designed to be modular so API users can provide their own implementations (store in S3 etc..).