def __init__(self): """ Create a new Response defaulting to HTML content and "200 OK" status """ self.status = "200 OK" self.headers = HeaderDict({"content-type": "text/html"}) self.cookies = SimpleCookie()
def __init__(self): """ Create a new Response defaulting to HTML content and "200 OK" status """ self.status = "200 OK" self.headers = HeaderDict({"content-type": "text/html"}) # Allow cross-site scripting self.headers["Access-Control-Allow-Origin"] = "*" self.headers[ "Access-Control-Allow-Headers"] = "Content-Type, X-Requested-With, X-Requested-By" self.headers["Access-Control-Allow-Methods"] = "POST, GET" self.cookies = SimpleCookie()
def __init__(self, content=b'', mimetype=None, code=200): self._iter = None self._is_str_iter = True self.content = content self.headers = HeaderDict() self.cookies = SimpleCookie() self.status_code = code defaults = self.defaults._current_obj() if not mimetype: mimetype = defaults.get('content_type', 'text/html') charset = defaults.get('charset') if charset: mimetype = '%s; charset=%s' % (mimetype, charset) self.headers.update(defaults.get('headers', {})) self.headers['Content-Type'] = mimetype self.errors = defaults.get('errors', 'strict')
def __init__(self): self.headers = HeaderDict({'content-type': 'text/html'})
def __init__(self): self.headers = HeaderDict({"content-type": "text/html"})