Liking cljdoc? Tell your friends :D

babashka.http-client


clientclj

(client opts)

Construct a custom client. To get the same behavior as the (implicit) default client, pass default-client-opts.

Options:

  • :follow-redirects - :never, :always or :normal
  • :connect-timeout - connection timeout in milliseconds.
  • :request - default request options which will be used in requests made with this client.
  • :executor - a java.util.concurrent.Executor

Returns map with:

  • :client, a java.net.http.HttpClient.

The map can be passed to request via the :client key.

Construct a custom client. To get the same behavior as the (implicit) default client, pass `default-client-opts`.

Options:
* `:follow-redirects` - `:never`, `:always` or `:normal`
* `:connect-timeout` - connection timeout in milliseconds.
* `:request` - default request options which will be used in requests made with this client.
* `:executor` - a `java.util.concurrent.Executor`

Returns map with:

* `:client`, a `java.net.http.HttpClient`.

The map can be passed to `request` via the `:client` key.
raw docstring

default-client-optsclj

Options used to create the (implicit) default client.

Options used to create the (implicit) default client.
raw docstring

deleteclj

(delete uri)
(delete uri opts)

Convenience wrapper for request with method :delete

Convenience wrapper for `request` with method `:delete`
raw docstring

getclj

(get uri)
(get uri opts)

Convenience wrapper for request with method :get

Convenience wrapper for `request` with method `:get`
raw docstring

(head uri)
(head uri opts)

Convenience wrapper for request with method :head

Convenience wrapper for `request` with method `:head`
raw docstring

patchclj

(patch url)
(patch url opts)

Convenience wrapper for request with method :patch

Convenience wrapper for `request` with method `:patch`
raw docstring

postclj

(post uri)
(post uri opts)

Convenience wrapper for request with method :post

Convenience wrapper for `request` with method `:post`
raw docstring

putclj

(put url)
(put url opts)

Convenience wrapper for request with method :put

Convenience wrapper for `request` with method `:put`
raw docstring

requestclj

(request opts)

Perform request. Returns map with at least :body, :status

Options:

  • :uri - the uri to request (required). May be a string or map of :schema (required), :host (required), :port, :path and :query
  • :headers - a map of headers
  • :method - the request method: :get, :post, :head, :delete, :patch or :put
  • :interceptors - custom interceptor chain
  • :client - a client as produced by client. If not provided a default client will be used.
  • :async - perform request asynchronously. The response will be a CompletableFuture of the response map.
  • :async-then - a function that is called on the async result if successful
  • :async-catch - a function that is called on the async result if exceptional
  • :timeout - request timeout in milliseconds.
  • :version - the HTTP version: :http1.1 or :http2.
Perform request. Returns map with at least `:body`, `:status`

Options:

* `:uri` - the uri to request (required).
   May be a string or map of `:schema` (required), `:host` (required), `:port`, `:path` and `:query`
* `:headers` - a map of headers
* `:method` - the request method: `:get`, `:post`, `:head`, `:delete`, `:patch` or `:put`
* `:interceptors` - custom interceptor chain
* `:client` - a client as produced by `client`. If not provided a default client will be used.
* `:async` - perform request asynchronously. The response will be a `CompletableFuture` of the response map.
* `:async-then` - a function that is called on the async result if successful
* `:async-catch` - a function that is called on the async result if exceptional
* `:timeout` - request timeout in milliseconds.
* `:version` - the HTTP version: `:http1.1` or `:http2`.
raw docstring

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

× close