Liking cljdoc? Tell your friends :D

puppetlabs.http.client.async


callback-responseclj

(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
sourceraw docstring

clojure-compress-request-body-type->javaclj

(clojure-compress-request-body-type->java opts)

Inputs: [opts :- common/RequestOptions] Returns: CompressType

Inputs: [opts :- common/RequestOptions]
Returns: CompressType
sourceraw docstring

clojure-method->javaclj

(clojure-method->java opts)

Inputs: [opts :- common/UserRequestOptions]

Inputs: [opts :- common/UserRequestOptions]
sourceraw docstring

clojure-options->javaclj

(clojure-options->java opts)

Inputs: [opts :- common/RequestOptions] Returns: RequestOptions

Inputs: [opts :- common/RequestOptions]
Returns: RequestOptions
sourceraw docstring

clojure-response-body-type->javaclj

(clojure-response-body-type->java opts)

Inputs: [opts :- common/RequestOptions] Returns: ResponseBodyType

Inputs: [opts :- common/RequestOptions]
Returns: ResponseBodyType
sourceraw docstring

create-clientclj

(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):

  • :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
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
sourceraw docstring

create-default-clientclj

(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
sourceraw docstring

get-response-delivery-delegateclj

(get-response-delivery-delegate opts result)

Inputs: [opts :- common/UserRequestOptions result :- common/ResponsePromise] Returns: ResponseDeliveryDelegate

Inputs: [opts :- common/UserRequestOptions result :- common/ResponsePromise]
Returns: ResponseDeliveryDelegate
sourceraw docstring

java-content-type->cljclj

(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
sourceraw docstring

parse-metric-idclj

(parse-metric-id opts)
source

parse-urlclj

(parse-url {:keys [url query-params]})

Inputs: [{:keys [url query-params]}] Returns: URI

Inputs: [{:keys [url query-params]}]
Returns: URI
sourceraw docstring

request-with-clientclj

(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:

  • :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.
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.
sourceraw docstring

url-uri-string->uriclj

(url-uri-string->uri thing)

Inputs: [thing :- common/UrlOrUriOrString] Returns: URI

Inputs: [thing :- common/UrlOrUriOrString]
Returns: URI
sourceraw docstring

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

× close