Liking cljdoc? Tell your friends :D

fieldtest.http

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.
raw docstring

decide-handlerclj/s

(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).
sourceraw docstring

deciderclj/s

(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).
sourceraw docstring

default-max-body-bytesclj/s

Largest request body the handlers accept, in bytes.

Largest request body the handlers accept, in bytes.
sourceraw docstring

feedback-handlerclj/s

(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).
sourceraw docstring

reporterclj/s

(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`.
sourceraw docstring

versionclj/s

The wire format version this library writes and reads.

The wire format version this library writes and reads.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close