Next: , Previous: , Up: Basic in GNU Artanis   [Contents]

7.4 Emit Response

(response-emit body #:status 200 #:headers '() #:mtime (current-time))

body is the response body, it can be bytevector or literal string (in HTML).

#:status is HTTP status, 200 in default, which means OK.

#:headers let you specify customized HTTP headers. The headers must follow certain format, you have to read about the Response Headers.

#:mtime specifies the modify time in the response. GNU Artanis will generate it for you if you just ignore it.

(emit-response-with-file filename [headers <- '()])

filename is the filename to be sent as a response.

[headers] is the customized HTTP headers.