(->result {:keys [status body]} step-id)Map a raw HTTP response ({:status int :body string}) to a tagged result.
Public so implementations of BffHttp can reuse the same status-code
error mapping.
Map a raw HTTP response ({:status int :body string}) to a tagged result.
Public so implementations of `BffHttp` can reuse the same status-code
error mapping.A single-request HTTP transport. Extended below to plain fns (the natural
Clojure implementation), the Java BffHttpClient interface, and BFF's own
hato-backed default. Implementations return either a raw
{:status int :body str} that BFF maps through ->result, or a fully tagged
{:status :ok/:error ...} map that is passed through untouched.
A single-request HTTP transport. Extended below to plain fns (the natural
Clojure implementation), the Java BffHttpClient interface, and BFF's own
hato-backed default. Implementations return either a raw
{:status int :body str} that BFF maps through `->result`, or a fully tagged
{:status :ok/:error ...} map that is passed through untouched.(do-call this req)(call client {:keys [url step-id] :as req})Route an HTTP step through client (any BffHttp — hato default, plain fn,
or Java BffHttpClient). Errors are captured as tagged results — this never
throws.
Route an HTTP step through `client` (any BffHttp — hato default, plain fn, or Java BffHttpClient). Errors are captured as tagged results — this never throws.
(default-client)(default-client hato-opts)The built-in hato-backed BffHttp implementation. hato-opts is merged into
hato's build-http-client options; pass nil for the shared defaults.
The built-in hato-backed BffHttp implementation. `hato-opts` is merged into hato's `build-http-client` options; pass nil for the shared defaults.
(err code msg)(err code msg detail)(err code msg detail http-status)Build a tagged error result. Optional detail (map) attaches free-form
context; optional http-status (int) records the upstream HTTP status
code when the failure originated from an HTTP response, so a step's
spec-level errors: mapping can remap by status.
Build a tagged error result. Optional `detail` (map) attaches free-form context; optional `http-status` (int) records the upstream HTTP status code when the failure originated from an HTTP response, so a step's spec-level `errors:` mapping can remap by status.
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 |