Liking cljdoc? Tell your friends :D

hato.middleware

Adapted from https://www.github.com/dakrone/clj-http
raw docstring

accept-encoding-valueclj

(accept-encoding-value accept-encoding)
source

basic-auth-valueclj

(basic-auth-value {:keys [user pass]})
source

coerce-clojure-bodyclj

(coerce-clojure-body _ {:keys [body] :as resp})
source

coerce-form-paramscljmultimethod

source

coerce-json-bodyclj

(coerce-json-body {:keys [coerce]}
                  {:keys [body status] :as resp}
                  keyword?
                  strict?)
source

coerce-response-bodycljmultimethod

source

coerce-transit-bodyclj

(coerce-transit-body {:keys [transit-opts]} {:keys [body] :as resp} type)
source

content-type-valueclj

(content-type-value type)
source

decompress-bodycljmultimethod

source

default-middlewareclj

The default list of middleware hato uses for wrapping requests.

The default list of middleware hato uses for wrapping requests.
sourceraw docstring

detect-charsetclj

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

generate-query-stringclj

(generate-query-string params & [content-type multi-param-style])
source

generate-query-string-with-encodingclj

(generate-query-string-with-encoding params encoding multi-param-style)
source

gunzipclj

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

inflateclj

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

json-decodeclj

(json-decode & args)

Resolve and apply cheshire's json decoding dynamically.

Resolve and apply cheshire's json decoding dynamically.
sourceraw docstring

json-decode-strictclj

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

json-enabled?clj

source

json-encodeclj

(json-encode & args)

Resolve and apply cheshire's json encoding dynamically.

Resolve and apply cheshire's json encoding dynamically.
sourceraw docstring

multipart-requestclj

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

nest-params-requestclj

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

optclj

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

parse-transitclj

(parse-transit in type & [opts])

Resolve and apply Transit's JSON/MessagePack decoding.

Resolve and apply Transit's JSON/MessagePack decoding.
sourceraw docstring

parse-urlclj

(parse-url url)

Parse a URL string into a map of interesting parts.

Parse a URL string into a map of interesting parts.
sourceraw docstring

parse-user-infoclj

(parse-user-info user-info)
source

transit-enabled?clj

source

transit-encodeclj

(transit-encode out type & [opts])

Resolve and apply Transit's JSON/MessagePack encoding.

Resolve and apply Transit's JSON/MessagePack encoding.
sourceraw docstring

transit-opts-by-typeclj

(transit-opts-by-type type opts)

Returns the Transit options by type.

Returns the Transit options by type.
sourceraw docstring

transit-read-optsclj

source

transit-write-optsclj

source

unexceptional-status?clj

source

url-encodeclj

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

url-encode-illegal-charactersclj

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

when-posclj

(when-pos v)
source

wrap-acceptclj

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

wrap-accept-encodingclj

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

wrap-basic-authclj

(wrap-basic-auth client)

Middleware converting the :basic-auth option into an Authorization header.

Middleware converting the :basic-auth option into an Authorization header.
sourceraw docstring

wrap-content-typeclj

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

wrap-decompressionclj

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

wrap-exceptionsclj

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

wrap-form-paramsclj

(wrap-form-params client)

Middleware wrapping the submission or form parameters.

Middleware wrapping the submission or form parameters.
sourceraw docstring

wrap-methodclj

(wrap-method client)

Middleware converting the :method option into the :request-method option

Middleware converting the :method option into the :request-method option
sourceraw docstring

wrap-multipartclj

(wrap-multipart client)

Middleware wrapping multipart requests.

Middleware wrapping multipart requests.
sourceraw docstring

wrap-nested-paramsclj

(wrap-nested-params client)

Middleware wrapping nested parameters for query strings.

Middleware wrapping nested parameters for query strings.
sourceraw docstring

wrap-oauthclj

(wrap-oauth client)

Middleware converting the :oauth-token option into an Authorization header.

Middleware converting the :oauth-token option into an Authorization header.
sourceraw docstring

wrap-output-coercionclj

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

wrap-query-paramsclj

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

wrap-requestclj

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

wrap-request-timingclj

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

wrap-urlclj

(wrap-url client)

Middleware wrapping request URL parsing.

Middleware wrapping request URL parsing.
sourceraw docstring

wrap-user-infoclj

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

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close