Show small example on how to render content-type, headers, etc
mulderp opened this issue · comments
Hello,
I was just playing with Cuba, and I would need to render JSON in the response for simulating API calls. However, I can't quickly see in the docs, how you responds with non-HTML.
Any pointers?
Thanks!
You can do:
res.headers["Content-Type"] = "application/json; charset=utf-8"
res.write(foo.to_json)
nice! thanks for this snippet.