Skip to main content

send!

function

org.httpkit.server/send!

(send! [ch data] [ch data close-after-send?])
Sends data to client and returns true if the data was successfully sent, or false if the channel is closed. Data is sent directly to the client, NO RING MIDDLEWARE IS APPLIED. When unspecified, `close-after-send?` defaults to true for HTTP channels and false for WebSocket. Data form: {:headers _ :status _ :body _} or just body. Note that :headers and :status will be stripped for WebSocket and for HTTP streaming responses after the first. For WebSocket, a text frame is sent to client if data is String, a binary frame when data is byte[] or InputStream. For for HTTP streaming responses, data can be one of the type defined by Ring spec

No examples yet. Be the first to add one!