本文整理汇总了Python中werkzeug.wrappers.Response.get_data方法的典型用法代码示例。如果您正苦于以下问题:Python Response.get_data方法的具体用法?Python Response.get_data怎么用?Python Response.get_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类werkzeug.wrappers.Response
的用法示例。
在下文中一共展示了Response.get_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Response
# 需要导入模块: from werkzeug.wrappers import Response [as 别名]
# 或者: from werkzeug.wrappers.Response import get_data [as 别名]
# WSGI responses.
###############################################################################
# construct #######################################################
# For most mime types mimetype and content_type work the same, but
# the charset. If the mimetype passed and starting with text/, the
# charset is set. In contrast the content_type parameter is always
# added as header unmodified.
response = Response('Hello World', status=200)
# inspect #########################################################
# headers
response.headers['Content-Encoding'] = 'gzip'
# request body
response.get_data()
response.set_data()
# cookies
response.set_cookie('username', 'John')
# get (app_iter, status, headers)
response.get_wsig_response()
###############################################################################
# Request
# The request object is immutable. Modifications are not supported by
# default, you may however replace the immutable attributes with mutable
# attributes if you need to modify it.
# The request object may be shared in the same thread, but is not thread