chickadee » awful » awful-response-headers

awful-response-headers #!optional alistparameter

An alist to specify the headers to be used in the response. If the content-length header is not provided, awful will calculate it automatically.

Here's an example:

(use awful)

(enable-sxml #t)

(define (define-json path body)
  (define-page path
    (lambda ()
      (awful-response-headers '((content-type "text/json")))
      (body))
    no-template: #t))


(define-json (main-page-path)
  (lambda ()
    '("{a: 1}")))