本文整理汇总了Python中wheezy.http.HTTPResponse.headers方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPResponse.headers方法的具体用法?Python HTTPResponse.headers怎么用?Python HTTPResponse.headers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wheezy.http.HTTPResponse
的用法示例。
在下文中一共展示了HTTPResponse.headers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plaintext
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def plaintext(request):
response = HTTPResponse()
response.headers = [("Content-Type", "text/plain; charset=UTF-8")]
response.write("Hello, world!")
return response
示例2: get
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def get(self):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_JSON)]
response.write(response_db_write_queries())
return response
示例3: request_cache_read
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def request_cache_read(request):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_PLAIN)]
response.write(response_cached())
return response
示例4: request_db_read
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def request_db_read(request):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_JSON)]
response.write(response_db_read_queries())
return response
示例5: request_slow
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def request_slow(request):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_PLAIN)]
response.write(response_slow())
return response
示例6: request_html
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def request_html(request):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_HTML)]
response.write(response_html())
return response
示例7: request_json
# 需要导入模块: from wheezy.http import HTTPResponse [as 别名]
# 或者: from wheezy.http.HTTPResponse import headers [as 别名]
def request_json(request):
response = HTTPResponse()
response.headers = [(CONTENT_TYPE, CONTENT_TYPE_JSON)]
response.write(response_json())
return response