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.
(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.
(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.
(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.
(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
(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.
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 |