Ring response implementation.
Ring response implementation.
(handle-response response exchange)
Handles ring response map.
:headers
to response headers.:status
if presented.:session
.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.ByteBuffer
Similar to String
but response charset is not used.ResponseBody
protocol.Also accepts other types of response
:
nil
– empty response.
io.undertow.server.HttpHandler
– Undertow handler.
.handleRequest
on this handler.clojure.lang.IBlockingDeref
– future or promise.
Custom response types can be added by extending HandleResponse
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. + Custom body types can be added by extending [[ResponseBody]] protocol. Also accepts other types of `response`: - `nil` – empty response. + Responses with HTTP 404. - `io.undertow.server.HttpHandler` – Undertow handler. + Invokes `.handleRequest` on this handler. + This allows to initiate processing like websocket handshake. - `clojure.lang.IBlockingDeref` – future or promise. + Executes pending response asynchronously with 120 sec timeout. + This allows to initiate async execution from sync handler. Custom response types can be added by extending [[HandleResponse]] protocol. [1]: https://github.com/ring-clojure/ring/wiki/Concepts#responses
(response-charset-fn e)
Returns functions without arguments which returns response Charset
.
Returns functions without arguments which returns response `Charset`.
(send-response-fn body)
Returns function (fn [exchange])
which puts body
in server response.
Returns function `(fn [exchange])` which puts `body` in server response.
(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.
(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)`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close