chickadee » awful » awful-response-headers

(awful-response-headers [alist]) parameter

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)

(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}"))