Liking cljdoc? Tell your friends :D

salt.http


close-sseclj

(close-sse {:keys [:stream]})

Close manifold stream if any.

Close manifold stream if any.
sourceraw docstring

empty-line-patternclj

New line followed by whitespace chars ending with new line.

New line followed by whitespace chars ending with new line.
sourceraw docstring

last-empty-line-patternclj

Empty line not followed by another empty line. This regex uses negative lookahead and DOTALL mode.

Empty line not followed by another empty line.
This regex uses negative lookahead and DOTALL mode.
sourceraw docstring

mapcat-with-previousclj

(mapcat-with-previous f)
source

parse-bodyclj

(parse-body response)

Parse body from response using content-type header to determine format.

If content-type is missing or unsupported, or parsing error occurs, throw ex with response in data. If body is not present, return nil. If body is successfully parsed, return map and full response in meta.

Parse body from `response` using content-type header to determine format.

If content-type is missing or unsupported, or parsing error occurs, throw ex with response in data.
If body is not present, return nil.
If body is successfully parsed, return map and full response in meta.
sourceraw docstring

parse-sseclj

(parse-sse event)

Parse JSON from event if event is type of :data

Parse JSON from `event` if event is type of :data
sourceraw docstring

requestclj

(request req)

Invoke aleph.http/request and transform manifold deferred to core.async channel. Return new channel delivering response:

  • Ring response if ok
  • Exception if error occurs
Invoke `aleph.http/request` and transform manifold deferred to core.async channel.
Return new channel delivering response:

* Ring response if ok
* Exception if error occurs
sourceraw docstring

retriable-status-codesclj

Set pof retriable status codes based on https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Set pof retriable status codes based on 
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
sourceraw docstring

sseclj

(sse req)
(sse req pool-opts)

Invoke [[aleph.http/request]] on SSE endpoint and stream response to core.async channel.

Uses pool defined in sse-pool -> with 1 connection and raw-stream? option. Pool could be customized with pool-opts (see [[aleph.http/request]] documentation).

Server-sent events is a stream of text lines separated by empty lines.

Returns new channel delivering server-sent events with following types |Type | Attributes | Description |:-----------|:-----------| | :connect | :stream | Connection is established. Use :stream to close SSE. | :data | :id :data | One SSE event. When event contains multiple data attributes, they are concatenated with newline character. | :retry | :retry | SSE indicates to set retry-timeout. | :close | | Sent before stream and respective core.async channel is closed.

If SSE request could not be made, exception is written to the channel and channel is closed.

Invoke [[aleph.http/request]] on SSE endpoint and stream response to core.async channel.

Uses pool defined in `sse-pool` -> with 1 connection and raw-stream? option.
Pool could be customized with `pool-opts` (see [[aleph.http/request]] documentation).

Server-sent events is a stream of text lines separated by empty lines.

Returns new channel delivering server-sent events with following types
|Type        | Attributes | Description
|:-----------|:-----------|
| `:connect` | :stream    | Connection is established. Use :stream to close SSE. 
| `:data`    | :id :data  | One SSE event. When event contains multiple data attributes, they are concatenated with newline character.
| `:retry`   | :retry     | SSE indicates to set retry-timeout.
| `:close`   |            | Sent before stream and respective core.async channel is closed.

If SSE request could not be made, exception is written to the channel and channel is closed.
sourceraw docstring

sse-buffer->eventsclj

(sse-buffer->events buf prev-buf)
source

sse-supported-attrsclj

source

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

× close