(api-call method end-point)
(api-call method end-point positional)
(api-call method end-point positional query)
(environ-auth env)
Lookup :gh-username and :gh-password in environ (~/.lein/profiles.clj or .lein-env) and return a string auth. Usage: (users/me {:auth (environ-auth)})
Lookup :gh-username and :gh-password in environ (~/.lein/profiles.clj or .lein-env) and return a string auth. Usage: (users/me {:auth (environ-auth)})
(format-url end-point positional)
Creates a URL out of end-point and positional. Called URLEncoder/encode on the elements of positional and then formats them in.
Creates a URL out of end-point and positional. Called URLEncoder/encode on the elements of positional and then formats them in.
(no-content? x)
Takes a response and returns true if it is a 204 response, false otherwise.
Takes a response and returns true if it is a 204 response, false otherwise.
(parse-json s)
Same as json/parse-string but handles nil gracefully.
Same as json/parse-string but handles nil gracefully.
(parse-links link-body)
Takes the content of the link header from a github resp, returns a map of links
Takes the content of the link header from a github resp, returns a map of links
(query-map entries)
Turn keywords into strings, and replace hyphens with underscores.
Turn keywords into strings, and replace hyphens with underscores.
(raw-api-call method end-point)
(raw-api-call method end-point positional)
(raw-api-call method end-point positional query)
(safe-parse {:keys [headers status body] :as resp})
Takes a response and checks for certain status codes. If 204, return nil. If 400, 401, 204, 422, 403, 404 or 500, return the original response with the body parsed as json. Otherwise, parse and return the body if json, or return the body if not json
Takes a response and checks for certain status codes. If 204, return nil. If 400, 401, 204, 422, 403, 404 or 500, return the original response with the body parsed as json. Otherwise, parse and return the body if json, or return the body if not json
(update-req req url)
Given a clj-http request, and a 'next' url string, merge the next url into the request
Given a clj-http request, and a 'next' url string, merge the next url into the request
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close