Open rapenne-s opened 11 years ago
You can use caveman:*response*
in controller functions.
It is a response object of caveman.response:<response>
which is a subclass of clack.response:
(setf (clack.response:headers *response* :content-type) "application/rss+xml")
Thank you for your precise answer, it works great !
Would you merge a pull request if I add some documentation to caveman ?
Sure :)
I'm aware that the documentation isn't enough. I'll appreciate your contribution.
Hi, I've got two ideas:
@ignore params
(in the function body preamble) is placed:@url GET "/names.json"
(defun get-names-json (params)
@content-type "text/json"
....)
But let the setf
way of altering the content type for special cases.
Thanks!
As far as I understand this annotation might be defined somewhat like:
(defannotation content-type (mime)
(:arity 1)
`(setf (clack.response:headers *response* :content-type) ,mime))
Please include it (if it is correct) and you find it useful as well. Thanks!
This would be a very nice addition !
I have some problems related with Apache + mod_lisp because not content-type is defined, or serving RSS feed not served as a XML or stuff like that.
How can I specify the content-type of a response ? I have seen that it is possible to do it in Clack, but I don't understand how to access it from caveman.