(->scope scope)
(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.
(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.
(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.
(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.
(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.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close