Liking cljdoc? Tell your friends :D

aleph.http.client-middleware

This middleware is adapted from clj-http, whose license is amendable to this sort of copy/pastery

This middleware is adapted from clj-http, whose license is amendable to this sort of
copy/pastery
raw docstring

accept-encoding-valueclj

(accept-encoding-value accept-encoding)
source

basic-auth-valueclj

(basic-auth-value basic-auth)
source

client-error?clj

(client-error? {:keys [status]})
source

coerce-clojure-bodyclj

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

coerce-form-paramscljmultimethod

source

coerce-json-bodyclj

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

coerce-response-bodycljmultimethod

source

coerce-transit-bodyclj

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

conflict?clj

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

content-type-valueclj

(content-type-value type)
source

default-middlewareclj

source

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

dissoc-inclj

(dissoc-in m [k & ks :as keys])

Dissociates an entry from a nested associative structure returning a new nested structure. keys is a sequence of keys. Any empty maps that result will not be present in the new structure.

Dissociates an entry from a nested associative structure returning a new
nested structure. keys is a sequence of keys. Any empty maps that result
will not be present in the new structure.
sourceraw docstring

follow-redirectclj

(follow-redirect client
                 {:keys [uri url scheme server-name server-port trace-redirects]
                  :or {trace-redirects []}
                  :as req}
                 {:keys [body] :as rsp})

Attempts to follow the redirects from the "location" header, if no such header exists (bad server!), returns the response without following the request.

Attempts to follow the redirects from the "location" header, if no such
header exists (bad server!), returns the response without following the
request.
sourceraw docstring

generate-query-stringclj

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

generate-query-string-with-encodingclj

(generate-query-string-with-encoding params encoding)
source

handle-redirectsclj

(handle-redirects client
                  {:keys [request-method max-redirects redirects-count
                          trace-redirects url]
                   :or {redirects-count 0 max-redirects 20}
                   :as req}
                  {:keys [status] :as rsp})

Middleware that follows redirects in the response. A slingshot exception is thrown if too many redirects occur. Options :follow-redirects - default:true, whether to follow redirects :max-redirects - default:20, maximum number of redirects to follow :force-redirects - default:false, force redirecting methods to GET requests

In the response: :redirects-count - number of redirects :trace-redirects - vector of sites the request was redirected from

Middleware that follows redirects in the response. A slingshot exception is
thrown if too many redirects occur. Options
:follow-redirects - default:true, whether to follow redirects
:max-redirects - default:20, maximum number of redirects to follow
:force-redirects - default:false, force redirecting methods to GET requests

In the response:
:redirects-count - number of redirects
:trace-redirects - vector of sites the request was redirected from
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

missing?clj

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

optclj

(opt req param)

Check 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)

Check 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-content-typeclj

(parse-content-type s)

Parse s as an RFC 2616 media type.

Parse `s` as an RFC 2616 media type.
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

redirect?clj

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

server-error?clj

(server-error? {:keys [status]})
source

success?clj

(success? {:keys [status]})
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

unexceptional-status?clj

source

updateclj

(update m k f & args)
source

url-encodeclj

(url-encode s)
(url-encode s encoding)
source

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 {:keys [accept] :as req})

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 {:keys [accept-encoding] :as req})

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 req)

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 {:keys [content-type character-encoding] :as req})

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-exceptionsclj

(wrap-exceptions client)

Middleware that throws a slingshot exception if the response is not a regular response. If :throw-entire-message? is set to true, the entire response is used as the message, instead of just the status number.

Middleware that throws a slingshot exception if the response is not a
regular response. If :throw-entire-message? is set to true, the entire
response is used as the message, instead of just the status number.
sourceraw docstring

wrap-form-paramsclj

(wrap-form-params {:keys [form-params content-type request-method]
                   :or {content-type :x-www-form-urlencoded}
                   :as req})

Middleware wrapping the submission or form parameters.

Middleware wrapping the submission or form parameters.
sourceraw docstring

wrap-methodclj

(wrap-method req)

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

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

wrap-nested-paramsclj

(wrap-nested-params {:keys [content-type] :as req})

Middleware wrapping nested parameters for query strings.

Middleware wrapping nested parameters for query strings.
sourceraw docstring

wrap-oauthclj

(wrap-oauth req)

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

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

wrap-query-paramsclj

(wrap-query-params {:keys [query-params content-type]
                    :or {content-type :x-www-form-urlencoded}
                    :as req})

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 client)

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 req)

Middleware wrapping request URL parsing.

Middleware wrapping request URL parsing.
sourceraw docstring

wrap-user-infoclj

(wrap-user-info req)

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