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