当前位置: 首页>>代码示例>>Python>>正文


Python HTTPResponse.headers方法代码示例

本文整理汇总了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
开发者ID:based2,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:app.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_web.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_http.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_http.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_http.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_http.py

示例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
开发者ID:CodeArtLibs,项目名称:codeart-benchmarks,代码行数:7,代码来源:_wheezy_http.py


注:本文中的wheezy.http.HTTPResponse.headers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。