(b64-decode string)
b64 decodes a utf8 string.
b64 decodes a utf8 string.
(b64-encode bytes)
b64 encodes a collection of bytes as utf8.
b64 encodes a collection of bytes as utf8.
(cartridge-playback-fixture output-path)
(cartridge-playback-fixture output-path key-fn)
Meant to be used as a once fixture, this function wraps our recording middlewares around subsequent clj-http requests, writing the responses to output-path
Meant to be used as a once fixture, this function wraps our recording middlewares around subsequent clj-http requests, writing the responses to output-path
(deserialize-body resp)
Reads and reconstitutes the body
Reads and reconstitutes the body
(read-responses-from-disk path)
reads responses from a path via edn/read-string
reads responses from a path via edn/read-string
(save-responses-to-disk path responses)
Encodes the body of the responses and saves them at the given path interpreted as a file.
Encodes the body of the responses and saves them at the given path interpreted as a file.
(saved-request-key req)
Keys a request for storage. Default key-fn
Keys a request for storage. Default `key-fn`
(serialize-body {:keys [body] :as resp})
Preps the body for writing to disk. Strings and nil pass through untouched, everything else is base64 encoded.
Preps the body for writing to disk. Strings and nil pass through untouched, everything else is base64 encoded.
(stash-stream-body {:keys [body] :as resp})
If the response body is an InputStream, it is fully read into a byte array and stashed at ::body-content in the response map
If the response body is an InputStream, it is fully read into a byte array and stashed at ::body-content in the response map
(transform-responses responses transform-fn)
Takes a map of responses, applying transform-fn to each response
Takes a map of responses, applying transform-fn to each response
(with-cartridge [saved-responses-atom & [key-fn]] & body)
Accepts an atom, optional key-fn
and body. Records clj-http
request/response pairs into the atom. If a key-fn is passed, that
is used to key the request for storage. Your atom should be a map.
Accepts an atom, optional `key-fn` and body. Records clj-http request/response pairs into the atom. If a key-fn is passed, that is used to key the request for storage. Your atom should be a map.
(wrap-playback-request saved-responses-atom key-fn client)
clj-http middleware to record http responses or playback extant recordings
clj-http middleware to record http responses or playback extant recordings
(wrap-save-raw-request client)
clj-http middleware that preserves the raw request
clj-http middleware that preserves the raw request
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close