firstopinion/endpoints — pull request #1 by jaridmargolin (2013-10-15 03:41:33+00:00)
Title: Set cont-type header before get_callback_info

The purpose of this PR is to allow more flexibility for setting the "Content-Type" header inside of controllers.

If the "Content-Type" header is set prior to get_callback_info, I can set the "Content-Type" header for a full controller inside the \__init__ method

class Default(Controller):
"""
HTML response route handling
"""
def __init__(self, request, response):
"""
Set Content-Type header to application/json
"""
super(Default, self).__init__(request, response)
self.response.headers['Content-Type'] = "text/html"