Liking cljdoc? Tell your friends :D

e85th.commons.net.rpc


bearer-authclj

(bearer-auth req token)

Add a bearer authorization in to the request headers

Add a bearer authorization in to the request headers
sourceraw docstring

call!clj

(call! req)
(call! req cb)
(call! method url http-opts)
(call! method url http-opts cb)

Returns a promise if no callback is passed in. Derefing the promise will yield the http response. http-opts is a map of options used by http-kit. method is a keyword

Returns a promise if no callback is passed in.
Derefing the promise will yield the http response.
http-opts is a map of options used by http-kit.
method is a keyword
sourceraw docstring

check-successful-responseclj

(check-successful-response resp)
(check-successful-response {:keys [status body] :as resp} non-success-fn)

Checks that the input response map has a successful status code (200 series) and returns the input response. If unsuccessful (non 200 series response code), invokes non-success-fn with the response map. The 1 arity function throws an exception.

Checks that the input response map has a successful status code (200 series) and returns the
input response.  If unsuccessful (non 200 series response code), invokes non-success-fn with the
response map.  The 1 arity function throws an exception.
sourceraw docstring

content-type->nameclj

(content-type->name s)

Returns a keyword ie :json, :edn or :other. NB input ``s can be nil.

Returns a keyword ie :json, :edn or :other. NB input ``s can be `nil`.
sourceraw docstring

edn?clj

(edn? content-type)

Answers true if the content-type is application/json. Ignores case, handles nil.

Answers true if the content-type is application/json. Ignores case, handles nil.
sourceraw docstring

http-success-status-codesclj

source

json-contentclj

(json-content req)
(json-content req body)

Adds in content-type and json encodes the body.

Adds in content-type and json encodes the body.
sourceraw docstring

json?clj

(json? content-type)

Answers true if the content-type is application/json. Ignores case, handles nil.

Answers true if the content-type is application/json. Ignores case, handles nil.
sourceraw docstring

new-requestclj

(new-request method url)
source

parse-response-bodyclj

(parse-response-body resp)
(parse-response-body edn-read-opts {:keys [body headers] :as resp})
source

parse-successful-responseclj

Checks for a successful response and parses the response body to a clojure data structure

Checks for a successful response and parses the response body to a clojure data structure
sourceraw docstring

query-paramsclj

(query-params req params-map)
source

success?clj

(success? status-code)

Answers if the input status-code is a http success code.

Answers if the input status-code is a http success code.
sourceraw docstring

sync-call!clj

(sync-call! req)
(sync-call! method url http-opts)

Makes a blocking http call. Returns the parsed response body as a clojure data structure. http-opts is a map of options used by http-kit.

Makes a blocking http call.  Returns the parsed response body as a clojure
data structure. http-opts is a map of options used by http-kit.
sourceraw docstring

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

× close