(client url)
(client url opts)
Create a new HTTP client that utilises the given TCP or UNIX domain socket to perform HTTP communication. Options are:
:timeout-ms
: A timeout that will be used for connect/call/read/write
timeout settings, unless they are explicitly specified using the
following options:
:connect-timeout-ms
:call-timeout-ms
:read-timeout-ms
:write-timeout-ms
:builder-fn
: A function that will be called on the underlying
OkHttpClient$Builder
and can be used to perform arbitrary adjustments
to the HTTP client (with exception of the socket factory.:mode
: A keyword describing the connection behaviour:
:default
: A reusable client will be created, except for raw socket
access where a new connection will be established.:reuse
: A reusable client will be created, and raw socket access will
not be possible.:recreate
: For every request a new client will be created; this might
be useful if you encounter problems with sharing the client across
threads.Examples:
(client "unix:///var/run/docker.sock")
(client "tcp://127.0.0.1:6537")
Create a new HTTP client that utilises the given TCP or UNIX domain socket to perform HTTP communication. Options are: - `:timeout-ms`: A timeout that will be used for connect/call/read/write timeout settings, unless they are explicitly specified using the following options: - `:connect-timeout-ms` - `:call-timeout-ms` - `:read-timeout-ms` - `:write-timeout-ms` - `:builder-fn`: A function that will be called on the underlying `OkHttpClient$Builder` and can be used to perform arbitrary adjustments to the HTTP client (with exception of the socket factory. - `:mode`: A keyword describing the connection behaviour: - `:default`: A reusable client will be created, except for raw socket access where a new connection will be established. - `:reuse`: A reusable client will be created, and raw socket access will not be possible. - `:recreate`: For every request a new client will be created; this might be useful if you encounter problems with sharing the client across threads. Examples: ``` (client "unix:///var/run/docker.sock") (client "tcp://127.0.0.1:6537") ```
(delete client url)
(delete client url opts)
Perform a DELETE request against the given client. Options are:
:headers
: a map of string/string pairs that will be sent as headers.:query-params
: a map of string/string pairs that will be sent as the query string.:as
: if set to :stream
the response's body will be an InputStream
value (that needs to be closed after consuming).:throw-exceptions
: if set to false
all responses will be returned and no exception is thrown on HTTP error codes.Perform a DELETE request against the given client. Options are: - `:headers`: a map of string/string pairs that will be sent as headers. - `:query-params`: a map of string/string pairs that will be sent as the query string. - `:as`: if set to `:stream` the response's body will be an `InputStream` value (that needs to be closed after consuming). - `:throw-exceptions`: if set to `false` all responses will be returned and no exception is thrown on HTTP error codes.
(get client url)
(get client url opts)
Perform a GET request against the given client. Options are:
:headers
: a map of string/string pairs that will be sent as headers.:query-params
: a map of string/string pairs that will be sent as the query string.:as
: if set to :stream
the response's body will be an InputStream
value (that needs to be closed after consuming).:throw-exceptions
: if set to false
all responses will be returned and no exception is thrown on HTTP error codes.Perform a GET request against the given client. Options are: - `:headers`: a map of string/string pairs that will be sent as headers. - `:query-params`: a map of string/string pairs that will be sent as the query string. - `:as`: if set to `:stream` the response's body will be an `InputStream` value (that needs to be closed after consuming). - `:throw-exceptions`: if set to `false` all responses will be returned and no exception is thrown on HTTP error codes.
(head client url)
(head client url opts)
Perform a HEAD request against the given client. Options are:
:headers
: a map of string/string pairs that will be sent as headers.:query-params
: a map of string/string pairs that will be sent as the query string.:as
: if set to :stream
the response's body will be an InputStream
value (that needs to be closed after consuming).:throw-exceptions
: if set to false
all responses will be returned and no exception is thrown on HTTP error codes.Perform a HEAD request against the given client. Options are: - `:headers`: a map of string/string pairs that will be sent as headers. - `:query-params`: a map of string/string pairs that will be sent as the query string. - `:as`: if set to `:stream` the response's body will be an `InputStream` value (that needs to be closed after consuming). - `:throw-exceptions`: if set to `false` all responses will be returned and no exception is thrown on HTTP error codes.
(post client url)
(post client url opts)
Perform a POST request against the given client. Options are:
:headers
: a map of string/string pairs that will be sent as headers.:query-params
: a map of string/string pairs that will be sent as the query string.:as
: if set to :stream
the response's body will be an InputStream
value (that needs to be closed after consuming).:throw-exceptions
: if set to false
all responses will be returned and no exception is thrown on HTTP error codes.Perform a POST request against the given client. Options are: - `:headers`: a map of string/string pairs that will be sent as headers. - `:query-params`: a map of string/string pairs that will be sent as the query string. - `:as`: if set to `:stream` the response's body will be an `InputStream` value (that needs to be closed after consuming). - `:throw-exceptions`: if set to `false` all responses will be returned and no exception is thrown on HTTP error codes.
(put client url)
(put client url opts)
Perform a PUT request against the given client. Options are:
:headers
: a map of string/string pairs that will be sent as headers.:query-params
: a map of string/string pairs that will be sent as the query string.:as
: if set to :stream
the response's body will be an InputStream
value (that needs to be closed after consuming).:throw-exceptions
: if set to false
all responses will be returned and no exception is thrown on HTTP error codes.Perform a PUT request against the given client. Options are: - `:headers`: a map of string/string pairs that will be sent as headers. - `:query-params`: a map of string/string pairs that will be sent as the query string. - `:as`: if set to `:stream` the response's body will be an `InputStream` value (that needs to be closed after consuming). - `:throw-exceptions`: if set to `false` all responses will be returned and no exception is thrown on HTTP error codes.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close