Liking cljdoc? Tell your friends :D

clj-okhttp.core


bad-request?clj

(bad-request? {:keys [status]})
source

case-statuscljmacro

(case-status status & range+clause)
source

caselet-responsecljmacro

(caselet-response binding & range+clause)
source

client-error?clj

(client-error? {:keys [status]})
source

conflict?clj

(conflict? {:keys [status]})
source

connectclj

(connect client
         req
         {:keys [on-open on-bytes on-text on-closing on-closed on-failure]
          :or {on-open (fn default-on-open [socket response])
               on-bytes (fn default-on-bytes [socket message])
               on-text (fn default-on-text [socket message])
               on-closing (fn default-on-closing [socket code reason])
               on-closed (fn default-on-closed [socket code reason])
               on-failure (fn default-on-failure [socket exception response])}})

Opens a websocket connection using the provided http upgrade request. Registers callbacks for the various events in a websocket lifecycle.

ring-style middleware are used to transform the upgrade request in the same way that they are used elsewhere for a http request. no middleware is applied per-message on the socket and messages are delivered to user callbacks in raw string/byte form.

Returns an OkHttp3.Websocket instance that can be used to send messages on the open socket. Callbacks also receive this same instance so they can easily send replies to the other end of the socket.

Opens a websocket connection using the provided http upgrade request.
Registers callbacks for the various events in a websocket lifecycle.

ring-style middleware are used to transform the upgrade request in the
same way that they are used elsewhere for a http request. no middleware
is applied per-message on the socket and messages are delivered to user
callbacks in raw string/byte form.

Returns an OkHttp3.Websocket instance that can be used to send messages
on the open socket. Callbacks also receive this same instance so they can
easily send replies to the other end of the socket.
sourceraw docstring

create-clientclj

(create-client)
(create-client opts)
(create-client client opts)

Creates a OkHttpClient instance with the specified options. Simple options can be expressed with clojure data but you may need to construct OkHttp object instances for the larger http client plugins. Note that you probably should not be using OkHttp interceptors and should instead provide your own ring-style middleware as the 'middleware' option. Middleware can be set per-client instance and per-request.

Creates a OkHttpClient instance with the specified options. Simple options can be
expressed with clojure data but you may need to construct OkHttp object instances
for the larger http client plugins. Note that you probably should not be using
OkHttp interceptors and should instead provide your own ring-style middleware as
the 'middleware' option. Middleware can be set per-client instance and per-request.
sourceraw docstring

deleteclj

(delete client url)
(delete client url req)
(delete client url req respond raise)

Executes a http delete request.

Executes a http delete request.
sourceraw docstring

forbidden?clj

(forbidden? {:keys [status]})
source

getclj

(get client url)
(get client url req)
(get client url req respond raise)

Executes a http get request.

Executes a http get request.
sourceraw docstring

(head client url)
(head client url req)
(head client url req respond raise)

Executes a http head request.

Executes a http head request.
sourceraw docstring

not-found?clj

(not-found? {:keys [status]})
source

optionsclj

(options client url)
(options client url req)
(options client url req respond raise)

Executes a http options request.

Executes a http options request.
sourceraw docstring

patchclj

(patch client url req)
(patch client url req respond raise)

Executes a http patch request.

Executes a http patch request.
sourceraw docstring

postclj

(post client url req)
(post client url req respond raise)

Executes a http post request.

Executes a http post request.
sourceraw docstring

putclj

(put client url req)
(put client url req respond raise)

Executes a http put request.

Executes a http put request.
sourceraw docstring

redirect?clj

(redirect? {:keys [status]})
source

requestclj

(request client request)
(request client request respond raise)

Executes a http request. Requests consist of clojure data in the same style as other http client libraries like clj-http.

The 2 arity invokes a synchronous request and returns a response map.

The 4 arity invokes an asynchronous request and returns a OkHttp3.Call instance that can be used to cancel / abort the request as long as it's still in flight.

Executes a http request. Requests consist of clojure data in the same style
as other http client libraries like clj-http.

The 2 arity invokes a synchronous request and returns a response map.

The 4 arity invokes an asynchronous request and returns a OkHttp3.Call instance
that can be used to cancel / abort the request as long as it's still in flight.
sourceraw docstring

server-error?clj

(server-error? {:keys [status]})
source

success?clj

(success? {:keys [status]})
source

unauthorized?clj

(unauthorized? {:keys [status]})
source

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

× close