Raises a 400 if request content type is not as specified.

def require_content_type(self, content_type):
        """Raises a 400 if request content type is not as specified."""
        if self.request.headers.get('content-type', '') != content_type:
            self.halt(400, 'Content type must be ' + content_type)