Liking cljdoc? Tell your friends :D

happyapi.middleware

Wrapping facilitates an abstract http-request rather than a specific implementation, and allows for configuration of cross-cutting concerns.

Wrapping facilitates an abstract http-request rather than a specific implementation,
and allows for configuration of cross-cutting concerns.
raw docstring

apikey-paramclj

(apikey-param args apikey)

Given credentials, returns a header suitable for merging into a request.

Given credentials, returns a header suitable for merging into a request.
sourceraw docstring

bearer-headerclj

(bearer-header args bearer)
source

dejsonizeclj

(dejsonize args resp decode keywordize-keys)
source

enjsonizeclj

(enjsonize args encode)
source

extract-resultclj

(extract-result {:keys [body]})
source

fn-or-var?clj

(fn-or-var? f)
source

informative-exceptionclj

(informative-exception id ex args)
source

json?clj

(json? resp)
source

maybe-keywordize-keysclj

(maybe-keywordize-keys args resp keywordize-keys)
source

maybe-updateclj

(maybe-update args k f & more)
source

paging-interruptedclj

(paging-interrupted ex items)
source

remove-redundant-data-labelsclj

(remove-redundant-data-labels x)
source

request-pagesclj

(request-pages request args)
source

request-pages-asyncclj

(request-pages-async request args respond raise items)
source

success?clj

(success? {:keys [status]})
source

uri-from-templateclj

(uri-from-template {:as args :keys [uri-template uri-template-args]})
source

wrap-apikey-authclj

(wrap-apikey-auth request apikey)
source

(wrap-cookie-policy-standard request)
source

wrap-debugclj

(wrap-debug request)
source

wrap-extract-resultclj

(wrap-extract-result request)

When we call an API, we want the logical result of the call, not the map containing body, and status. We also don't need to preserve the type of arrays, so we can remove that layer of indirection (:items is unnecessary). When using this middleware, you should also use a client or middleware that throws when status indicates failure, to prevent logical results when there is an error.

When we call an API, we want the logical result of the call, not the map containing body, and status.
We also don't need to preserve the type of arrays, so we can remove that layer of indirection (:items is unnecessary).
When using this middleware, you should also use a client or middleware that throws when status indicates failure,
to prevent logical results when there is an error.
sourceraw docstring

wrap-informative-exceptionsclj

(wrap-informative-exceptions request)
source

wrap-jsonclj

(wrap-json request
           {:as config :keys [keywordize-keys] {:keys [encode decode]} :fns})

Converts the body of responses to a data structure. Pluggable json implementations resolved from dependencies, or can be passed as an argument. Keywordization can be enabled with :keywordize-keys true.

Error responses don't throw exceptions when parsing fails. Success responses that fail to parse are rethrown with the response and request as context.

Converts the body of responses to a data structure.
Pluggable json implementations resolved from dependencies, or can be passed as an argument.
Keywordization can be enabled with :keywordize-keys true.

Error responses don't throw exceptions when parsing fails.
Success responses that fail to parse are rethrown with the response and request as context.
sourceraw docstring

wrap-keywordize-keysclj

(wrap-keywordize-keys request keywordize-keys)
source

wrap-pagingclj

(wrap-paging request)

When fetching collections, will request all pages. This may take a long time. wrap-paging must come before wrap-deitemize when used together

When fetching collections, will request all pages.
This may take a long time.
`wrap-paging` must come before `wrap-deitemize` when used together
sourceraw docstring

wrap-uri-templateclj

(wrap-uri-template request)

Arguments to APIs may appear in the url path, query-string, or body of a request. This middleware assists with the correct application of path arguments. When :uri-template is present, it adds :url which is the application of the template with :uri-template-args. See https://datatracker.ietf.org/doc/html/rfc6570 for more information about uri-templates.

Arguments to APIs may appear in the url path, query-string, or body of a request.
This middleware assists with the correct application of path arguments.
When :uri-template is present, it adds :url which is the application of the template with :uri-template-args.
See https://datatracker.ietf.org/doc/html/rfc6570 for more information about uri-templates.
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