本文整理汇总了Python中aspen.http.request.Request.from_diesel方法的典型用法代码示例。如果您正苦于以下问题:Python Request.from_diesel方法的具体用法?Python Request.from_diesel怎么用?Python Request.from_diesel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspen.http.request.Request
的用法示例。
在下文中一共展示了Request.from_diesel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from aspen.http.request import Request [as 别名]
# 或者: from aspen.http.request.Request import from_diesel [as 别名]
def __call__(self, diesel_request):
"""Given a Diesel request, return a Diesel response.
"""
request = Request.from_diesel(diesel_request) # too big to fail :-/
response = self.handle(request)
return response._to_diesel(diesel_request) # sends bits, returns bool
示例2: handle
# 需要导入模块: from aspen.http.request import Request [as 别名]
# 或者: from aspen.http.request.Request import from_diesel [as 别名]
def handle(path):
website = Website(Configuration(['fsfix']))
return website.handle(Request.from_diesel(DieselReq(path)))
示例3: make_request
# 需要导入模块: from aspen.http.request import Request [as 别名]
# 或者: from aspen.http.request.Request import from_diesel [as 别名]
def make_request():
return Request.from_diesel(DieselReq())
示例4: check
# 需要导入模块: from aspen.http.request import Request [as 别名]
# 或者: from aspen.http.request.Request import from_diesel [as 别名]
def check():
website = Website(Configuration(['fsfix']))
response = website.handle(Request.from_diesel(DieselReq()))
return response