Liking cljdoc? Tell your friends :D

jj.potoroo.httpclient

A thin, idiomatic Clojure wrapper around the JDK's built-in HTTP client

A thin, idiomatic Clojure wrapper around the JDK's built-in HTTP client
raw docstring

as-bytesclj

Reads the whole body into a byte array.

Reads the whole body into a byte array.
sourceraw docstring

as-streamclj

Hands back the raw InputStream. The caller owns it, and must close it.

Hands back the raw InputStream. The caller owns it, and must close it.
sourceraw docstring

as-stringclj

Reads the whole body and decodes it with the response's charset.

Reads the whole body and decodes it with the response's charset.
sourceraw docstring

charset-ofclj

(charset-of headers)

The charset advertised by a response's content-type headers, UTF-8 if absent. Public so a ResponseTransformer can decode text the way as-string does.

The charset advertised by a response's content-type headers, UTF-8 if absent.
Public so a ResponseTransformer can decode text the way `as-string` does.
sourceraw docstring

clientclj

(client)
(client {:keys [connect-timeout-ms follow-redirects version]})

Build a java.net.http.HttpClient.

Options: :connect-timeout-ms connection timeout in milliseconds (default: none) :follow-redirects :always | :normal | :never (default: :normal) :version :http-1.1 | :http-2 (default: :http-2)

Build a java.net.http.HttpClient.

Options:
  :connect-timeout-ms  connection timeout in milliseconds (default: none)
  :follow-redirects    :always | :normal | :never (default: :normal)
  :version             :http-1.1 | :http-2 (default: :http-2)
sourceraw docstring

default-request-transformerclj

Used when a request supplies no :body-as.

Handles the body types the JDK client already understands: nil (no body), String, byte[], and an already-built BodyPublisher. Anything else is a caller error - reach for a transformer that knows how to serialize it.

Used when a request supplies no :body-as.

Handles the body types the JDK client already understands: nil (no body),
String, byte[], and an already-built BodyPublisher. Anything else is a
caller error - reach for a transformer that knows how to serialize it.
sourceraw docstring

deleteclj

(delete url & [opts])
source

getclj

(get url & [opts])
source

(head url & [opts])
source

patchclj

(patch url & [opts])
source

postclj

(post url & [opts])
source

putclj

(put url & [opts])
source

queryclj

(query url & [opts])
source

requestclj

(request {:keys [client as] :as req})
source

RequestTransformercljprotocol

Turns a request into a java.net.http BodyPublisher.

Chosen per-request with :body-as, the way :as chooses a ResponseTransformer. Receives the whole request map, not just :body, so a transformer can also look at :headers - a multipart one, say, reading its boundary off the caller's content-type.

Turns a request into a java.net.http BodyPublisher.

Chosen per-request with :body-as, the way :as chooses a ResponseTransformer.
Receives the whole request map, not just :body, so a transformer can also
look at :headers - a multipart one, say, reading its boundary off the
caller's content-type.

->requestclj

(->request this req)
sourceraw docstring

ResponseTransformercljprotocol

Turns the raw response body into the value put on :body.

Chosen per-request with :as. Receives the whole response map - :status, :headers, and :body holding the raw InputStream - so a transformer can branch on the status or read a header the charset alone would not tell it (a multipart boundary, say); charset-of derives the charset from :headers. Implementations that consume the stream must close it.

Turns the raw response body into the value put on :body.

Chosen per-request with :as. Receives the whole response map - :status,
:headers, and :body holding the raw InputStream - so a transformer can branch
on the status or read a header the charset alone would not tell it (a
multipart boundary, say); `charset-of` derives the charset from :headers.
Implementations that consume the stream must close it.

->responseclj

(->response this resp)
sourceraw 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