Liking cljdoc? Tell your friends :D

dgknght.tasks.http

Send HTTP requests, following redirects for any method.

A successful request returns a map of the response's :url (the one it finally came from, after redirects), :headers and :body. Anything else throws an ex-info whose data has the request's :url and a :type of:

::unreachable The server couldn't be reached ::unauthorized The server rejected the credentials (401) ::not-found Nothing is at the URL (404, 410) ::method-not-allowed The resource doesn't support the method (405) ::precondition-failed A conditional header didn't match (412) ::unexpected-response The server responded with something else

Except for ::unreachable, the data also has the response's :status and :body.

Each request sent, including each redirect followed, is logged at DEBUG with its method, URL, status and duration, but not its headers or body. Credentials are never logged.

Send HTTP requests, following redirects for any method.

A successful request returns a map of the response's :url (the one it
finally came from, after redirects), :headers and :body. Anything else
throws an ex-info whose data has the request's :url and a :type of:

  ::unreachable          The server couldn't be reached
  ::unauthorized         The server rejected the credentials (401)
  ::not-found            Nothing is at the URL (404, 410)
  ::method-not-allowed   The resource doesn't support the method (405)
  ::precondition-failed  A conditional header didn't match (412)
  ::unexpected-response  The server responded with something else

Except for ::unreachable, the data also has the response's :status and
:body.

Each request sent, including each redirect followed, is logged at DEBUG
with its method, URL, status and duration, but not its headers or body.
Credentials are never logged.
raw docstring

requestclj

(request req opts)

Sends the clj-http request and returns the response if it succeeded. Options include: :username Identifies the user making the request :password Proves the identity of the user :multistatus? Indicates the request expects multiple parts possibly with different statuses :throw-on-no-content? Indicates that a successful response without content is an exception :throw-if-not-committed? Indicates a 202 status is an exception

Sends the clj-http request and returns the response if it succeeded.
Options include:
  :username     Identifies the user making the request
  :password     Proves the identity of the user
  :multistatus? Indicates the request expects multiple parts possibly with
                different statuses
  :throw-on-no-content? Indicates that a successful response without content
                        is an exception
  :throw-if-not-committed? Indicates a 202 status is an exception
raw docstring

resolve-urlclj

(resolve-url base href)

Resolves the href, which may be relative, against the base URL.

Resolves the href, which may be relative, against the base URL.
raw docstring

successful-status-line?clj

(successful-status-line? line)

Whether the status line, e.g. "HTTP/1.1 200 OK" as found in a WebDAV multistatus, reports success.

Whether the status line, e.g. "HTTP/1.1 200 OK" as found in a WebDAV
multistatus, reports success.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close