(callback-response opts callback response)Inputs: [opts :- common/UserRequestOptions callback :- common/ResponseCallbackFn response :- common/Response] Returns: common/Response
Inputs: [opts :- common/UserRequestOptions callback :- common/ResponseCallbackFn response :- common/Response] Returns: common/Response
(clojure-compress-request-body-type->java opts)Inputs: [opts :- common/RequestOptions] Returns: CompressType
Inputs: [opts :- common/RequestOptions] Returns: CompressType
(clojure-method->java opts)Inputs: [opts :- common/UserRequestOptions]
Inputs: [opts :- common/UserRequestOptions]
(clojure-options->java opts)Inputs: [opts :- common/RequestOptions] Returns: RequestOptions
Inputs: [opts :- common/RequestOptions] Returns: RequestOptions
(clojure-response-body-type->java opts)Inputs: [opts :- common/RequestOptions] Returns: ResponseBodyType
Inputs: [opts :- common/RequestOptions] Returns: ResponseBodyType
(create-client opts)Inputs: [opts :- common/ClientOptions] Returns: (schema/protocol common/HTTPClient)
Creates a client to be used for making one or more HTTP requests.
opts (base set):
opts (ssl-specific where only one of the following combinations permitted):
OR
OR
Inputs: [opts :- common/ClientOptions]
Returns: (schema/protocol common/HTTPClient)
Creates a client to be used for making one or more HTTP requests.
opts (base set):
* :force-redirects - used to set whether or not the client should follow
redirects on POST or PUT requests. Defaults to false.
* :follow-redirects - used to set whether or not the client should follow
redirects in general. Defaults to true. If set to false, will override
the :force-redirects setting.
* :connect-timeout-milliseconds - maximum number of milliseconds that the
client will wait for a connection to be established. A value of zero is
interpreted as infinite. A negative value for or the absence of this
option is interpreted as undefined (system default).
* :socket-timeout-milliseconds - maximum number of milliseconds that the
client will allow for no data to be available on the socket before
closing the underlying connection, 'SO_TIMEOUT' in socket terms. A
timeout of zero is interpreted as an infinite timeout. A negative value
for or the absence of this setting is interpreted as undefined (system
default).
* :ssl-protocols - used to set the list of SSL protocols that the client
could select from when talking to the server. Defaults to 'TLSv1',
'TLSv1.1', and 'TLSv1.2'.
* :cipher-suites - used to set the cipher suites that the client could
select from when talking to the server. Defaults to the complete
set of suites supported by the underlying language runtime.
* :metric-registry - a MetricRegistry instance used to collect metrics
on client requests.
opts (ssl-specific where only one of the following combinations permitted):
* :ssl-context - an instance of SSLContext
OR
* :ssl-cert - path to a PEM file containing the client cert
* :ssl-key - path to a PEM file containing the client private key
* :ssl-ca-cert - path to a PEM file containing the CA cert
OR
* :ssl-ca-cert - path to a PEM file containing the CA cert(create-default-client
{:keys [ssl-context ssl-ca-cert ssl-cert ssl-key ssl-protocols cipher-suites
follow-redirects force-redirects connect-timeout-milliseconds
socket-timeout-milliseconds metric-registry server-id metric-prefix
enable-url-metrics? max-connections-total max-connections-per-route]})Inputs: [{:keys [ssl-context ssl-ca-cert ssl-cert ssl-key ssl-protocols cipher-suites follow-redirects force-redirects connect-timeout-milliseconds socket-timeout-milliseconds metric-registry server-id metric-prefix enable-url-metrics? max-connections-total max-connections-per-route]} :- common/ClientOptions] Returns: CloseableHttpAsyncClient
Inputs: [{:keys [ssl-context ssl-ca-cert ssl-cert ssl-key ssl-protocols cipher-suites follow-redirects force-redirects connect-timeout-milliseconds socket-timeout-milliseconds metric-registry server-id metric-prefix enable-url-metrics? max-connections-total max-connections-per-route]} :- common/ClientOptions]
Returns: CloseableHttpAsyncClient(get-response-delivery-delegate opts result)Inputs: [opts :- common/UserRequestOptions result :- common/ResponsePromise] Returns: ResponseDeliveryDelegate
Inputs: [opts :- common/UserRequestOptions result :- common/ResponsePromise] Returns: ResponseDeliveryDelegate
(java-content-type->clj java-content-type)Inputs: [java-content-type :- (schema/maybe ContentType)] Returns: common/ContentType
Inputs: [java-content-type :- (schema/maybe ContentType)] Returns: common/ContentType
(parse-url {:keys [url query-params]})Inputs: [{:keys [url query-params]}] Returns: URI
Inputs: [{:keys [url query-params]}]
Returns: URI(request-with-client opts callback client)(request-with-client opts callback client metric-registry metric-namespace)(request-with-client opts
callback
client
metric-registry
metric-namespace
enable-url-metrics?)Inputs: ([opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient] [opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient metric-registry :- (schema/maybe MetricRegistry) metric-namespace :- (schema/maybe schema/Str)] [opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient metric-registry :- (schema/maybe MetricRegistry) metric-namespace :- (schema/maybe schema/Str) enable-url-metrics? :- schema/Bool]) Returns: common/ResponsePromise
Issues an async HTTP request with the specified client and returns a promise
object to which the value of
(callback {:opts _ :status _ :headers _ :body _}) or
(callback {:opts _ :error _}) will be delivered.
When unspecified, callback is the identity function.
opts:
true, an 'accept-encoding' header with a value of
'gzip, deflate' will be added to the request, and the response will be
automatically decompressed if it contains a recognized 'content-encoding'
header. defaults to true.:text, :stream and :unbuffered-stream. :text will return a String,
:stream and :unbuffered-stream will return an InputStream. Note that
:stream holds the full response in memory (i.e. a ByteArrayInputStream).
Use :unbufferred-stream for large response bodies or to consume less memory.
Defaults to :stream.Inputs: ([opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient] [opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient metric-registry :- (schema/maybe MetricRegistry) metric-namespace :- (schema/maybe schema/Str)] [opts :- common/RawUserRequestOptions callback :- common/ResponseCallbackFn client :- HttpAsyncClient metric-registry :- (schema/maybe MetricRegistry) metric-namespace :- (schema/maybe schema/Str) enable-url-metrics? :- schema/Bool])
Returns: common/ResponsePromise
Issues an async HTTP request with the specified client and returns a promise
object to which the value of
`(callback {:opts _ :status _ :headers _ :body _})` or
`(callback {:opts _ :error _})` will be delivered.
When unspecified, `callback` is the identity function.
opts:
* :url
* :method - the HTTP method (:get, :head, :post, :put, :delete, :trace,
:options, :patch)
* :headers - a map of headers
* :body - the body; may be a String or any type supported by clojure's reader
* :decompress-body - if `true`, an 'accept-encoding' header with a value of
'gzip, deflate' will be added to the request, and the response will be
automatically decompressed if it contains a recognized 'content-encoding'
header. defaults to `true`.
* :as - used to control the data type of the response body. Supported values
are `:text`, `:stream` and `:unbuffered-stream`. `:text` will return a `String`,
`:stream` and `:unbuffered-stream` will return an `InputStream`. Note that
`:stream` holds the full response in memory (i.e. a `ByteArrayInputStream`).
Use `:unbufferred-stream` for large response bodies or to consume less memory.
Defaults to `:stream`.
* :query-params - used to set the query parameters of an http request
* :metric-id - array of strings or keywords, used to set the metrics to be
timed for the request.(url-uri-string->uri thing)Inputs: [thing :- common/UrlOrUriOrString] Returns: URI
Inputs: [thing :- common/UrlOrUriOrString] Returns: URI
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |