(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.
Options used to create the (implicit) default client.
Options used to create the (implicit) default client.
(delete uri)
(delete uri opts)
Convenience wrapper for request
with method :delete
Convenience wrapper for `request` with method `:delete`
(get uri)
(get uri opts)
Convenience wrapper for request
with method :get
Convenience wrapper for `request` with method `:get`
(head uri)
(head uri opts)
Convenience wrapper for request
with method :head
Convenience wrapper for `request` with method `:head`
(patch url)
(patch url opts)
Convenience wrapper for request
with method :patch
Convenience wrapper for `request` with method `:patch`
(post uri)
(post uri opts)
Convenience wrapper for request
with method :post
Convenience wrapper for `request` with method `:post`
(put url)
(put url opts)
Convenience wrapper for request
with method :put
Convenience wrapper for `request` with method `:put`
(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`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close