Liking cljdoc? Tell your friends :D

strojure.ring-undertow.impl.response

Ring response implementation.

Ring response implementation.
raw docstring

handle-responseclj

(handle-response response exchange)

Handles ring response map.

  • Puts :headers to response headers.
  • Sets :status if presented.
  • Updates ring session data by :session.
  • Sends response body.
    • Standard ring response body types:
      • String The body is sent directly to the client in response charset.
      • ISeq Each element of the seq is sent to the client as a string in response charset.
      • File The contents of the referenced file is sent to the client.
      • InputStream The contents of the stream is sent to the client. When the stream is exhausted, the stream is closed.
    • Additional body types:
      • ByteBuffer Similar to String but response charset is not used.
      • HttpHandler The Undertow handler in the :body is handled, this allows to initiate processing like websocket handshake.
    • Custom body types can be added by extending ResponseBody protocol.
Handles [ring response map][1].

- Puts `:headers` to response headers.
- Sets `:status` if presented.
- Updates ring session data by `:session`.
- Sends response body.
    + Standard ring response body types:
        - `String`      The body is sent directly to the client in response
                        charset.
        - `ISeq`        Each element of the seq is sent to the client as a
                        string in response charset.
        - `File`        The contents of the referenced file is sent to the
                        client.
        - `InputStream` The contents of the stream is sent to the client. When
                        the stream is exhausted, the stream is closed.
    + Additional body types:
        - `ByteBuffer`  Similar to `String` but response charset is not used.
        - `HttpHandler` The Undertow handler in the `:body` is handled, this
                        allows to initiate processing like websocket handshake.
    + Custom body types can be added by extending [[ResponseBody]] protocol.

[1]: https://github.com/ring-clojure/ring/wiki/Concepts#responses
sourceraw docstring

response-charset-fnclj

(response-charset-fn e)

Returns functions without arguments which returns response Charset.

Returns functions without arguments which returns response `Charset`.
sourceraw docstring

ResponseBodycljprotocol

send-response-fnclj

(send-response-fn body)

Returns function (fn [exchange]) which puts body in server response.

Returns function `(fn [exchange])` which puts `body` in server response.
source

with-output-streamclj

(with-output-stream send-response)

Returns function (fn [exchange]) which invokes (send-response output-stream charset-fn) dispatching to worker thread if necessary.

Returns function `(fn [exchange])` which invokes
`(send-response output-stream charset-fn)` dispatching to worker thread if
necessary.
sourceraw docstring

with-response-senderclj

(with-response-sender send-response)

Returns function (fn [exchange]) which invokes (send-response response-sender charset-fn).

Returns function `(fn [exchange])` which invokes
`(send-response response-sender charset-fn)`.
sourceraw docstring

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

× close