(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.
(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).
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!)
(delete client url)
(delete client url request)
(delete client url request respond raise)
Executes a http delete request.
Executes a http delete request.
(get* client url)
(get* client url request)
(get* client url request respond raise)
Executes a http get request.
Executes a http get request.
(head client url)
(head client url request)
(head client url request respond raise)
Executes a http head request.
Executes a http head request.
(options client url)
(options client url request)
(options client url request respond raise)
Executes a http options request.
Executes a http options request.
(patch client url request)
(patch client url request respond raise)
Executes a http patch request.
Executes a http patch request.
(post client url request)
(post client url request respond raise)
Executes a http post request.
Executes a http post request.
(put client url request)
(put client url request respond raise)
Executes a http put request.
Executes a http put request.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close