Liking cljdoc? Tell your friends :D

atlassian.client

Generic Atlassian HTTP core — the ONLY namespace that touches the network.

Built on hato (an idiomatic Clojure wrapper over the JDK 11 java.net.http client). This is a small, generic request engine, NOT a function-per-endpoint wrapper: product surfaces (atlassian.jira., atlassian.bitbucket., atlassian.confluence.*) build their typed functions on top of request.

A client handle is a plain map:

{:http <hato client> ; shared, reusable connection pool :auth "Basic ..." ; Authorization header value :config {...}} ; the resolving config (bases, product, etc.)

Tests never need this: they call the product functions with a stub request fn, so nothing here requires live credentials to exercise.

Generic Atlassian HTTP core — the ONLY namespace that touches the network.

Built on hato (an idiomatic Clojure wrapper over the JDK 11 java.net.http
client). This is a small, generic request engine, NOT a function-per-endpoint
wrapper: product surfaces (atlassian.jira.*, atlassian.bitbucket.*,
atlassian.confluence.*) build their typed functions on top of `request`.

A client handle is a plain map:

  {:http <hato client>   ; shared, reusable connection pool
   :auth "Basic ..."     ; Authorization header value
   :config {...}}         ; the resolving config (bases, product, etc.)

Tests never need this: they call the product functions with a stub `request`
fn, so nothing here requires live credentials to exercise.
raw docstring

make-clientclj

(make-client {:keys [config auth http]})

Build a client handle from a resolved config map and an Authorization header. Reuses a shared, process-wide hato client unless one is supplied via :http.

Build a client handle from a resolved config map and an Authorization header.
Reuses a shared, process-wide hato client unless one is supplied via
`:http`.
sourceraw docstring

query-stringclj

(query-string m)

Encode a query-param map. A sequential value expands to repeated pairs (id=a&id=b); scalars stay a single pair; nil values are dropped. Returns the empty string for an empty/blank map (no leading ?).

Encode a query-param map. A sequential value expands to repeated pairs
(id=a&id=b); scalars stay a single pair; nil values are dropped. Returns the
empty string for an empty/blank map (no leading `?`).
sourceraw docstring

requestclj

(request client
         {:keys [method url query body headers throw?]
          :or {method :get throw? true}})

Perform an HTTP request and return the parsed, keywordized JSON body on 2xx.

opts: :method - :get :post :put :delete (default :get) :url - absolute URL string (REQUIRED) :query - query-param map (sequential values -> repeated pairs) :body - EDN value, JSON-encoded into the request body :headers - extra request headers (merged over the defaults) :throw? - throw ex-info on non-2xx (default true)

On 2xx with a JSON body returns the keywordized value; an empty body (e.g. 204) returns nil. On non-2xx throws ex-info {:status :method :url :body} unless :throw? is false, in which case the same map is returned under :error.

Perform an HTTP request and return the parsed, keywordized JSON body on 2xx.

opts:
  :method  - :get :post :put :delete (default :get)
  :url     - absolute URL string (REQUIRED)
  :query   - query-param map (sequential values -> repeated pairs)
  :body    - EDN value, JSON-encoded into the request body
  :headers - extra request headers (merged over the defaults)
  :throw?  - throw ex-info on non-2xx (default true)

On 2xx with a JSON body returns the keywordized value; an empty body (e.g.
204) returns nil. On non-2xx throws ex-info `{:status :method :url :body}`
unless `:throw?` is false, in which case the same map is returned under
`:error`.
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