Liking cljdoc? Tell your friends :D

collet.actions.http


->scopeclj

(->scope scope)
source

attach-rate-limiterclj

(attach-rate-limiter action-spec)

Attaches a rate limiter to the action spec if a rate is provided.

Attaches a rate limiter to the action spec if a rate is provided.
sourceraw docstring

get-oauth2-tokenclj

(get-oauth2-token {:keys [url method client-id client-secret scope grant-type
                          auth-data as keywordize headers basic-auth]
                   :or {as :json keywordize true method :post}})

Get an OAuth2 token using the provided credentials.

Get an OAuth2 token using the provided credentials.
sourceraw docstring

http-requestclj

source

make-requestclj

(make-request {:keys [url method body keywordize as content-type accept]
               :or {method :get keywordize true}
               :as req-map})

Make an HTTP request and return the response. The request map can contain the following keys: :url - the URL to request :method - the HTTP method to use (default - :get) :body - the request body :keywordize - keywordize the keys in the response (default - true) :as - the response format :content-type - the content type of the request :accept - the accept header of the request :unexceptional-status - a set of unexceptional statuses :rate - the rate limit for the request. How many requests per second are allowed. :basic-auth - a vector of username and password for basic authentication.

Make an HTTP request and return the response.
The request map can contain the following keys:
:url - the URL to request
:method - the HTTP method to use (default - :get)
:body - the request body
:keywordize - keywordize the keys in the response (default - true)
:as - the response format
:content-type - the content type of the request
:accept - the accept header of the request
:unexceptional-status - a set of unexceptional statuses
:rate - the rate limit for the request. How many requests per second are allowed.
:basic-auth - a vector of username and password for basic authentication.
sourceraw docstring

oauth2-paramsclj

source

read-jsonclj

(read-json input keywordize)

Reads a JSON object from an input stream and optionally keywordizes keys.

Reads a JSON object from an input stream and optionally keywordizes keys.
sourceraw docstring

request-params-specclj

source

unexceptional-request-status?clj

(unexceptional-request-status? req status)

Returns true if the request status is not an exception. By default, the following statuses are considered unexceptional: 200, 201, 202, 203, 204, 205, 206, 207, 300, 301, 302, 303, 304, 307, 308. List of unexceptional statuses can be overridden by setting the :unexceptional-status key in the request map.

Returns true if the request status is not an exception.
By default, the following statuses are considered unexceptional:
200, 201, 202, 203, 204, 205, 206, 207, 300, 301, 302, 303, 304, 307, 308.
List of unexceptional statuses can be overridden by setting the :unexceptional-status key in the request map.
sourceraw docstring

unexceptional-status?clj

source

wrap-rate-limiterclj

(wrap-rate-limiter func)

Wraps a function with a rate limiter if one is provided in the options.

Wraps a function with a rate limiter if one is provided in the options.
sourceraw docstring

wrap-unexceptional-statusclj

(wrap-unexceptional-status func)

Wraps a function with a check for unexceptional statuses. If the status is not unexceptional, throws an exception.

Wraps a function with a check for unexceptional statuses.
If the status is not unexceptional, throws an exception.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close