Write-Http-Response

(write-http-response channel code reason headers body) -> #f

Writes an HTTP response to the given channel, using the headers given. Usually the channel is a <http-request> but can be arbitrary.

>>(write-http-response resp 200 "Peachy"' ("Content-Type: text/text")
    "Life is peachy")
:: #f

This is an example of using an arbitrary channel.

>> (define resp (make-channel))
:: [channel 5434E0]
>> (write-http-response resp 200 "Peachy" '("Content-Type: text/text") "Life is peachy")
:: null
>> (wait resp)
:: "HTTP/1.1 200 Peachy\r\nContent-Type: text/text\r\n\r\nLife is peachy"