Liking cljdoc? Tell your friends :D

http.async.client.request

Asynchronous HTTP Client - Clojure - Requesting API

Asynchronous HTTP Client - Clojure - Requesting API
raw docstring

*default-callbacks*clj

Default set of callbacks.

Default set of callbacks.
raw docstring

*user-agent*clj


body-collectclj

(body-collect state baos)

body-completedclj

(body-completed _)

convert-actionclj

(convert-action action)

Converts action (:abort, nil) to Async client STATE.

Converts action (:abort, nil) to Async client STATE.
raw docstring

convert-methodclj


error-collectclj

(error-collect _ t)

execute-requestclj

(execute-request client
                 req
                 &
                 {status :status
                  headers :headers
                  part :part
                  completed :completed
                  error :error})

Executes provided request. Arguments:

  • req - request to be executed
  • :status - status callback (optional, defaults to status-collect)
  • :headers - headers callback (optional, defaults to headers-collect)
  • :part - body part callback (optional, defaults to body-collect)
  • :completed - response completed (optional, defaults to body-completed)
  • :error - error callback (optional, defaults to error-collect)

Returns a map:

  • :id - unique ID of request
  • :status - promise that once status is received is delivered, contains lazy map of:
    • :code - response code
    • :msg - response message
    • :protocol - protocol with version
    • :major - major version of protocol
    • :minor - minor version of protocol
  • :headers - promise that once headers are received is delivered, contains lazy map of:
    • :server - header names are keyworded, values stay not changed
  • :body - body of response, depends on request type, might be ByteArrayOutputStream or lazy sequence, use conveniece methods to extract it, like string
  • :done - promise that is delivered once receiving response has finished
  • :error - promise that is delivered if requesting resource failed, once delivered will contain Throwable.
Executes provided request.
Arguments:
- req        - request to be executed
- :status    - status callback (optional, defaults to status-collect)
- :headers   - headers callback (optional, defaults to headers-collect)
- :part      - body part callback (optional, defaults to body-collect)
- :completed - response completed (optional, defaults to body-completed)
- :error     - error callback (optional, defaults to error-collect)

Returns a map:
- :id      - unique ID of request
- :status  - promise that once status is received is delivered, contains lazy map of:
  - :code     - response code
  - :msg      - response message
  - :protocol - protocol with version
  - :major    - major version of protocol
  - :minor    - minor version of protocol
- :headers - promise that once headers are received is delivered, contains lazy map of:
  - :server - header names are keyworded, values stay not changed
- :body    - body of response, depends on request type, might be ByteArrayOutputStream
             or lazy sequence, use conveniece methods to extract it, like string
- :done    - promise that is delivered once receiving response has finished
- :error   - promise that is delivered if requesting resource failed, once delivered
             will contain Throwable.
raw docstring

get-encodingclj

(get-encoding {ct :content-type :or {ct ""}})

Gets content encoding from headers, if Content-Type header not present or media-type in it is missing => nil

Gets content encoding from headers, if Content-Type header not present
or media-type in it is missing => nil
raw docstring

headers-collectclj

(headers-collect _ headers)

Reurns all headers, or aborts if no headers provided.

Reurns all headers, or aborts if no headers provided.
raw docstring

prepare-requestclj

(prepare-request method
                 url
                 &
                 {:keys [headers query body cookies proxy auth timeout]})

Prepares method (GET, POST, ..) request to url. Options: :query - map of query parameters, if value is vector than multiple values will be send as n=v1&n=v2 :headers - map of headers :body - body :cookies - cookies to send :proxy - map with proxy configuration to be used :host - proxy host :port - proxy port :protocol - (optional) protocol to communicate with proxy, :http (default, if you provide no value) and :https are allowed :user - (optional) user name to use for proxy authentication, has to be provided with :password :password - (optional) password to use for proxy authentication, has to be provided with :user :auth - map with authentication to be used :type - either :basic or :digest :user - user name to be used :password - password to be used :realm - realm name to authenticate in :preemptive - assume authentication is required :timeout - request timeout in ms

Prepares method (GET, POST, ..) request to url.
Options:
  :query   - map of query parameters, if value is vector than multiple values
             will be send as n=v1&n=v2
  :headers - map of headers
  :body    - body
  :cookies - cookies to send
  :proxy   - map with proxy configuration to be used
    :host     - proxy host
    :port     - proxy port
    :protocol - (optional) protocol to communicate with proxy,
                :http (default, if you provide no value) and :https are allowed
    :user     - (optional) user name to use for proxy authentication,
                has to be provided with :password
    :password - (optional) password to use for proxy authentication,
                has to be provided with :user
  :auth    - map with authentication to be used
    :type       - either :basic or :digest
    :user       - user name to be used
    :password   - password to be used
    :realm      - realm name to authenticate in
    :preemptive - assume authentication is required
  :timeout - request timeout in ms
raw docstring

status-collectclj

(status-collect _ status)

Returns all status and procides with execution

Returns all status and procides with execution
raw docstring

url-encodeclj

(url-encode arg)

Taken from Clojure Http Client

Taken from Clojure Http Client
raw docstring

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

× close