HTTP transport for decide requests and feedback.
Each request and response is a JSON document with the same fields as the
in-process version, plus "v": 1. Later versions will only add fields, so
readers skip fields they don't recognise. A server answers 400 to a version
it doesn't know.
The handlers take {:body ...} and return a promise of {:status :headers :body}, which makes them easy to mount in Ring, http-kit or anything else.
They don't do authentication, rate limiting or routing; wrap them in
whatever your server already uses.
HTTP transport for decide requests and feedback.
Each request and response is a JSON document with the same fields as the
in-process version, plus `"v": 1`. Later versions will only add fields, so
readers skip fields they don't recognise. A server answers 400 to a version
it doesn't know.
The handlers take `{:body ...}` and return a promise of `{:status :headers
:body}`, which makes them easy to mount in Ring, http-kit or anything else.
They don't do authentication, rate limiting or routing; wrap them in
whatever your server already uses.(decide-handler server)(decide-handler server
{:keys [max-body-bytes]
:or {max-body-bytes default-max-body-bytes}})A handler for decide requests. Takes {:body ...} and returns a promise of
{:status :headers :body} with a JSON decide response.
Options: :max-body-bytes (default 65,536).
A handler for decide requests. Takes `{:body ...}` and returns a promise of
`{:status :headers :body}` with a JSON decide response.
Options: `:max-body-bytes` (default 65,536).(decider url)(decider url opts)A decider that POSTs decide requests to url. Pass it to
fieldtest.client/decide, which adds the timeout and fallback.
Options: :headers to add to every request, and :post, a function
(fn [url body headers]) returning a promise of {:status :body}, to
replace the built-in HTTP client (js/fetch in ClojureScript and nbb,
java.net.http.HttpClient on the JVM).
A decider that POSTs decide requests to `url`. Pass it to
`fieldtest.client/decide`, which adds the timeout and fallback.
Options: `:headers` to add to every request, and `:post`, a function
`(fn [url body headers])` returning a promise of `{:status :body}`, to
replace the built-in HTTP client (`js/fetch` in ClojureScript and nbb,
`java.net.http.HttpClient` on the JVM).Largest request body the handlers accept, in bytes.
Largest request body the handlers accept, in bytes.
(feedback-handler server)(feedback-handler server
{:keys [max-body-bytes]
:or {max-body-bytes default-max-body-bytes}})A handler for feedback batches, {"v": 1, "feedback": [...]}. Takes
{:body ...} and returns a promise of {:status :headers :body}.
Options: :max-body-bytes (default 65,536).
A handler for feedback batches, `{"v": 1, "feedback": [...]}`. Takes
`{:body ...}` and returns a promise of `{:status :headers :body}`.
Options: `:max-body-bytes` (default 65,536).(reporter url)(reporter url opts)A reporter that POSTs feedback batches to url. Takes the same options as
decider.
A reporter that POSTs feedback batches to `url`. Takes the same options as `decider`.
The wire format version this library writes and reads.
The wire format version this library writes and reads.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |