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
         request
         {: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)

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 instead should provide your own ring-style middleware when making requests (so you can act on data representations instead of objects).

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 instead should provide your own ring-style middleware
when making requests (so you can act on data representations instead of objects).
sourceraw docstring

default-middlewareclj

The standard set of middleware used by this library to transform from a ring style request map -> OkHttp.Request -> OkHttp.Response -> ring style response map. Along the way this middleware takes care of request encoding and response decoding. If you choose to pass custom middleware into a request function you probably still want to include most if not all of these (order matters!)

The standard set of middleware used by this library to transform
from a ring style request map -> OkHttp.Request -> OkHttp.Response
-> ring style response map. Along the way this middleware takes care
of request encoding and response decoding. If you choose to pass custom
middleware into a request function you probably still want to include most
if not all of these (order matters!)
sourceraw docstring

deleteclj

(delete client url)
(delete client url request)
(delete client url request respond raise)

Executes a http delete request.

Executes a http delete request.
sourceraw docstring

forbidden?clj

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

get*clj

(get* client url)
(get* client url request)
(get* client url request respond raise)

Executes a http get request.

Executes a http get request.
sourceraw docstring

(head client url)
(head client url request)
(head client url request 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 request)
(options client url request respond raise)

Executes a http options request.

Executes a http options request.
sourceraw docstring

patchclj

(patch client url request)
(patch client url request respond raise)

Executes a http patch request.

Executes a http patch request.
sourceraw docstring

postclj

(post client url request)
(post client url request respond raise)

Executes a http post request.

Executes a http post request.
sourceraw docstring

putclj

(put client url request)
(put client url request respond raise)

Executes a http put request.

Executes a http put request.
sourceraw docstring

redirect?clj

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

request*clj

(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 okhttp.

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 okhttp.

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