Adapted from https://www.github.com/dakrone/clj-http
Adapted from https://www.github.com/dakrone/clj-http
(coerce-json-body {:keys [coerce]}
{:keys [body status] :as resp}
keyword?
strict?)
(coerce-transit-body {:keys [transit-opts]} {:keys [body] :as resp} type)
The default list of middleware hato uses for wrapping requests.
The default list of middleware hato uses for wrapping requests.
(detect-charset content-type)
Given a charset header, detect the charset, returns UTF-8 if not found.
Given a charset header, detect the charset, returns UTF-8 if not found.
(generate-query-string-with-encoding params encoding multi-param-style)
(gunzip b)
Returns a gunzip'd version of the given byte array or input stream.
Returns a gunzip'd version of the given byte array or input stream.
(inflate b)
Returns a zlib inflate'd version of the given byte array or InputStream.
Returns a zlib inflate'd version of the given byte array or InputStream.
(json-decode & args)
Resolve and apply cheshire's json decoding dynamically.
Resolve and apply cheshire's json decoding dynamically.
(json-decode-strict & args)
Resolve and apply cheshire's json decoding dynamically (with lazy parsing disabled).
Resolve and apply cheshire's json decoding dynamically (with lazy parsing disabled).
(json-encode & args)
Resolve and apply cheshire's json encoding dynamically.
Resolve and apply cheshire's json encoding dynamically.
(multipart-request {:keys [multipart] :as req})
Adds appropriate body and header if making a multipart request.
Adds appropriate body and header if making a multipart request.
(nest-params-request {:keys [content-type flatten-nested-keys] :as req})
Middleware wrapping nested parameters for query strings.
Middleware wrapping nested parameters for query strings.
(opt req param)
Checks the request parameters for a keyword boolean option, with or without the ?
Returns false if either of the values are false, or the value of (or key1 key2) otherwise (truthy)
Checks the request parameters for a keyword boolean option, with or without the ? Returns false if either of the values are false, or the value of (or key1 key2) otherwise (truthy)
(parse-transit in type & [opts])
Resolve and apply Transit's JSON/MessagePack decoding.
Resolve and apply Transit's JSON/MessagePack decoding.
(parse-url url)
Parse a URL string into a map of interesting parts.
Parse a URL string into a map of interesting parts.
(transit-encode out type & [opts])
Resolve and apply Transit's JSON/MessagePack encoding.
Resolve and apply Transit's JSON/MessagePack encoding.
(transit-opts-by-type type opts)
Returns the Transit options by type.
Returns the Transit options by type.
(url-encode unencoded & [encoding])
Returns a UTF-8 URL encoded version of the given string.
Returns a UTF-8 URL encoded version of the given string.
(url-encode-illegal-characters path-or-query)
Takes a raw url path or query and url-encodes any illegal characters. Minimizes ambiguity by encoding space to %20.
Takes a raw url path or query and url-encodes any illegal characters. Minimizes ambiguity by encoding space to %20.
(wrap-accept client)
Middleware converting the :accept key in a request to application/<type>
Middleware converting the :accept key in a request to application/<type>
(wrap-accept-encoding client)
Middleware converting the :accept-encoding option to an acceptable Accept-Encoding header in the request.
Middleware converting the :accept-encoding option to an acceptable Accept-Encoding header in the request.
(wrap-basic-auth client)
Middleware converting the :basic-auth option into an Authorization header.
Middleware converting the :basic-auth option into an Authorization header.
(wrap-content-type client)
Middleware converting a :content-type <keyword>
option to the formal
application/<name> format and adding it as a header.
Middleware converting a `:content-type <keyword>` option to the formal application/<name> format and adding it as a header.
(wrap-decompression client)
Middleware handling automatic decompression of responses from web servers. If
:decompress-body is set to false, does not automatically set Accept-Encoding
header or decompress body.
Middleware handling automatic decompression of responses from web servers. If :decompress-body is set to false, does not automatically set `Accept-Encoding` header or decompress body.
(wrap-exceptions client)
Middleware that throws response as an ExceptionInfo if the response has unsuccessful status code. :throw-exceptions set to false in the request disables this middleware.
Middleware that throws response as an ExceptionInfo if the response has unsuccessful status code. :throw-exceptions set to false in the request disables this middleware.
(wrap-form-params client)
Middleware wrapping the submission or form parameters.
Middleware wrapping the submission or form parameters.
(wrap-method client)
Middleware converting the :method option into the :request-method option
Middleware converting the :method option into the :request-method option
(wrap-multipart client)
Middleware wrapping multipart requests.
Middleware wrapping multipart requests.
(wrap-nested-params client)
Middleware wrapping nested parameters for query strings.
Middleware wrapping nested parameters for query strings.
(wrap-oauth client)
Middleware converting the :oauth-token option into an Authorization header.
Middleware converting the :oauth-token option into an Authorization header.
(wrap-output-coercion client)
Middleware converting a response body from a byte-array to a different object.
Defaults to a String if no :as key is specified, the coerce-response-body
multimethod may be extended to add additional coercions.
Middleware converting a response body from a byte-array to a different object. Defaults to a String if no :as key is specified, the `coerce-response-body` multimethod may be extended to add additional coercions.
(wrap-query-params client)
Middleware converting the :query-params option to a querystring on the request.
Middleware converting the :query-params option to a querystring on the request.
(wrap-request request)
(wrap-request request middleware)
Returns a batteries-included HTTP request function corresponding to the given core client. See default-middleware for the middleware wrappers that are used by default
Returns a batteries-included HTTP request function corresponding to the given core client. See default-middleware for the middleware wrappers that are used by default
(wrap-request-timing client)
Middleware that times the request, putting the total time (in milliseconds) of the request into the :request-time key in the response.
Middleware that times the request, putting the total time (in milliseconds) of the request into the :request-time key in the response.
(wrap-url client)
Middleware wrapping request URL parsing.
Middleware wrapping request URL parsing.
(wrap-user-info client)
Middleware converting the :user-info option into a :basic-auth option
Middleware converting the :user-info option into a :basic-auth option
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close