$overlay{_template.html#body} $begin{content}
QP makes setting the reponse status, content_type and body easy, and to actually send the response one just raises a RespondNow exception. Here is the Gizmo(QP) Publisher method [extracted GTi-automatically] that responds with the JSON rendering for the python object supplied as input data.
${evoque('pub/publisher.py#json_respond_now', collection='gz').strip(" \t#")}
See it in action:
${html.href('json-response-example',
"publisher.json_respond_now(dict(a=1, b='two', c='see'))",
)}