Liking cljdoc? Tell your friends :D

com.blockether.spel.network

Request, Response, Route, WebSocket operations.

All response and request accessor functions participate in the anomaly railway pattern: if passed an anomaly map (e.g. from a failed navigate), they pass it through unchanged instead of throwing ClassCastException.

Request, Response, Route, WebSocket operations.

All response and request accessor functions participate in the anomaly
railway pattern: if passed an anomaly map (e.g. from a failed navigate),
they pass it through unchanged instead of throwing ClassCastException.
raw docstring

request-all-headersclj

(request-all-headers req)

Returns all request headers including redirects. Passes through anomaly maps unchanged.

Returns all request headers including redirects.
Passes through anomaly maps unchanged.
sourceraw docstring

request-failureclj

(request-failure req)

Returns the failure text if the request failed. Passes through anomaly maps unchanged.

Returns the failure text if the request failed.
Passes through anomaly maps unchanged.
sourceraw docstring

request-frameclj

(request-frame req)

Returns the frame that initiated this request. Passes through anomaly maps unchanged.

Returns the frame that initiated this request.
Passes through anomaly maps unchanged.
sourceraw docstring

request-headersclj

(request-headers req)

Returns the request headers as a map. Passes through anomaly maps unchanged.

Returns the request headers as a map.
Passes through anomaly maps unchanged.
sourceraw docstring

request-is-navigation?clj

(request-is-navigation? req)

Returns whether this is a navigation request. Passes through anomaly maps unchanged.

Returns whether this is a navigation request.
Passes through anomaly maps unchanged.
sourceraw docstring

request-methodclj

(request-method req)

Returns the request HTTP method. Passes through anomaly maps unchanged.

Returns the request HTTP method.
Passes through anomaly maps unchanged.
sourceraw docstring

request-post-dataclj

(request-post-data req)

Returns the request POST data. Passes through anomaly maps unchanged.

Returns the request POST data.
Passes through anomaly maps unchanged.
sourceraw docstring

request-post-data-bufferclj

(request-post-data-buffer req)

Returns the request POST data as bytes. Passes through anomaly maps unchanged.

Returns the request POST data as bytes.
Passes through anomaly maps unchanged.
sourceraw docstring

request-redirected-fromclj

(request-redirected-from req)

Returns the request that redirected to this one. Passes through anomaly maps unchanged.

Returns the request that redirected to this one.
Passes through anomaly maps unchanged.
sourceraw docstring

request-redirected-toclj

(request-redirected-to req)

Returns the request this was redirected to. Passes through anomaly maps unchanged.

Returns the request this was redirected to.
Passes through anomaly maps unchanged.
sourceraw docstring

request-resource-typeclj

(request-resource-type req)

Returns the resource type (e.g. document, script, image). Passes through anomaly maps unchanged.

Returns the resource type (e.g. document, script, image).
Passes through anomaly maps unchanged.
sourceraw docstring

request-responseclj

(request-response req)

Returns the response for this request. Passes through anomaly maps unchanged.

Returns the response for this request.
Passes through anomaly maps unchanged.
sourceraw docstring

request-timingclj

(request-timing req)

Returns the request timing information. Passes through anomaly maps unchanged.

Returns the request timing information.
Passes through anomaly maps unchanged.
sourceraw docstring

request-urlclj

(request-url req)

Returns the request URL. Passes through anomaly maps unchanged.

Returns the request URL.
Passes through anomaly maps unchanged.
sourceraw docstring

response-all-headersclj

(response-all-headers resp)

Returns all response headers. Passes through anomaly maps unchanged.

Returns all response headers.
Passes through anomaly maps unchanged.
sourceraw docstring

response-bodyclj

(response-body resp)

Returns the response body as bytes. Passes through anomaly maps unchanged.

Returns the response body as bytes.
Passes through anomaly maps unchanged.
sourceraw docstring

response-finishedclj

(response-finished resp)

Returns nil when response finishes, or the failure error string. Passes through anomaly maps unchanged.

Returns nil when response finishes, or the failure error string.
Passes through anomaly maps unchanged.
sourceraw docstring

response-frameclj

(response-frame resp)

Returns the frame that received this response. Passes through anomaly maps unchanged.

Returns the frame that received this response.
Passes through anomaly maps unchanged.
sourceraw docstring

response-header-valueclj

(response-header-value resp name)

Returns the value of a specific header. Passes through anomaly maps unchanged.

Returns the value of a specific header.
Passes through anomaly maps unchanged.
sourceraw docstring

response-header-valuesclj

(response-header-values resp name)

Returns all values for a specific header. Passes through anomaly maps unchanged.

Returns all values for a specific header.
Passes through anomaly maps unchanged.
sourceraw docstring

response-headersclj

(response-headers resp)

Returns the response headers. Passes through anomaly maps unchanged.

Returns the response headers.
Passes through anomaly maps unchanged.
sourceraw docstring

response-ok?clj

(response-ok? resp)

Returns whether the response status is 2xx. Passes through anomaly maps unchanged.

Returns whether the response status is 2xx.
Passes through anomaly maps unchanged.
sourceraw docstring

response-requestclj

(response-request resp)

Returns the request for this response. Passes through anomaly maps unchanged.

Returns the request for this response.
Passes through anomaly maps unchanged.
sourceraw docstring

response-statusclj

(response-status resp)

Returns the HTTP status code. Passes through anomaly maps unchanged.

Returns the HTTP status code.
Passes through anomaly maps unchanged.
sourceraw docstring

response-status-textclj

(response-status-text resp)

Returns the HTTP status text. Passes through anomaly maps unchanged.

Returns the HTTP status text.
Passes through anomaly maps unchanged.
sourceraw docstring

response-textclj

(response-text resp)

Returns the response body as text. Passes through anomaly maps unchanged.

Returns the response body as text.
Passes through anomaly maps unchanged.
sourceraw docstring

response-urlclj

(response-url resp)

Returns the response URL. Passes through anomaly maps unchanged.

Returns the response URL.
Passes through anomaly maps unchanged.
sourceraw docstring

route-abort!clj

(route-abort! route)
(route-abort! route error-code)

Aborts the route.

Params: route - Route instance. error-code - String, optional. Error code.

Aborts the route.

Params:
`route`       - Route instance.
`error-code`  - String, optional. Error code.
sourceraw docstring

route-continue!clj

(route-continue! route)
(route-continue! route opts)

Continues the route, optionally modifying the request.

Params: route - Route instance. opts - Map, optional. Overrides.

Continues the route, optionally modifying the request.

Params:
`route` - Route instance.
`opts`  - Map, optional. Overrides.
sourceraw docstring

route-fallback!clj

(route-fallback! route)

Falls through to the next route handler.

Params: route - Route instance.

Falls through to the next route handler.

Params:
`route` - Route instance.
sourceraw docstring

route-fetch!clj

(route-fetch! route)

Performs the request and returns the response.

Params: route - Route instance.

Returns: APIResponse or anomaly map.

Performs the request and returns the response.

Params:
`route` - Route instance.

Returns:
APIResponse or anomaly map.
sourceraw docstring

route-fulfill!clj

(route-fulfill! route opts)

Fulfills the route with a custom response.

Params: route - Route instance. opts - Map with optional: :status - Long. HTTP status code. :headers - Map. Response headers. :body - String or byte[]. Response body. :content-type - String. Content type.

Fulfills the route with a custom response.

Params:
`route` - Route instance.
`opts`  - Map with optional:
  :status  - Long. HTTP status code.
  :headers - Map. Response headers.
  :body    - String or byte[]. Response body.
  :content-type - String. Content type.
sourceraw docstring

route-requestclj

(route-request route)

Returns the request being routed.

Returns the request being routed.
sourceraw docstring

ws-is-closed?clj

(ws-is-closed? ws)

Returns whether the WebSocket is closed.

Returns whether the WebSocket is closed.
sourceraw docstring

ws-on-closeclj

(ws-on-close ws handler)

Registers a handler for WebSocket close.

Params: ws - WebSocket instance. handler - Function that receives the WebSocket.

Registers a handler for WebSocket close.

Params:
`ws`      - WebSocket instance.
`handler` - Function that receives the WebSocket.
sourceraw docstring

ws-on-errorclj

(ws-on-error ws handler)

Registers a handler for WebSocket errors.

Params: ws - WebSocket instance. handler - Function that receives the error string.

Registers a handler for WebSocket errors.

Params:
`ws`      - WebSocket instance.
`handler` - Function that receives the error string.
sourceraw docstring

ws-on-messageclj

(ws-on-message ws handler)

Registers a handler for incoming messages.

Params: ws - WebSocket instance. handler - Function that receives a WebSocketFrame.

Registers a handler for incoming messages.

Params:
`ws`      - WebSocket instance.
`handler` - Function that receives a WebSocketFrame.
sourceraw docstring

ws-urlclj

(ws-url ws)

Returns the WebSocket URL.

Returns the WebSocket URL.
sourceraw docstring

wsf-binaryclj

(wsf-binary frame)

Returns the binary content of a WebSocket frame.

Returns the binary content of a WebSocket frame.
sourceraw docstring

wsf-textclj

(wsf-text frame)

Returns the text content of a WebSocket frame.

Returns the text content of a WebSocket frame.
sourceraw docstring

wsr-close!clj

(wsr-close! wsr)

Closes the WebSocket connection from the server side.

Params: wsr - WebSocketRoute instance.

Closes the WebSocket connection from the server side.

Params:
`wsr` - WebSocketRoute instance.
sourceraw docstring

wsr-connect-to-server!clj

(wsr-connect-to-server! wsr)

Connects to the real server WebSocket.

Params: wsr - WebSocketRoute instance.

Returns: WebSocketRoute for the server connection.

Connects to the real server WebSocket.

Params:
`wsr` - WebSocketRoute instance.

Returns:
WebSocketRoute for the server connection.
sourceraw docstring

wsr-on-closeclj

(wsr-on-close wsr handler)

Registers a handler for close events.

Params: wsr - WebSocketRoute instance. handler - Function called on close.

Registers a handler for close events.

Params:
`wsr`     - WebSocketRoute instance.
`handler` - Function called on close.
sourceraw docstring

wsr-on-messageclj

(wsr-on-message wsr handler)

Registers a handler for client messages on the route.

Params: wsr - WebSocketRoute instance. handler - Function that receives WebSocketFrame.

Registers a handler for client messages on the route.

Params:
`wsr`     - WebSocketRoute instance.
`handler` - Function that receives WebSocketFrame.
sourceraw docstring

wsr-send!clj

(wsr-send! wsr message)

Sends a message to the client.

Params: wsr - WebSocketRoute instance. message - String. Message to send.

Sends a message to the client.

Params:
`wsr`     - WebSocketRoute instance.
`message` - String. Message to send.
sourceraw docstring

wsr-urlclj

(wsr-url wsr)

Returns the URL of a WebSocketRoute.

Returns the URL of a WebSocketRoute.
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