示例#1
0
 def __call__(self, environ, start_response):
     try:
         request = WSGIRequest(environ)
     except:
         response = http.responses.error.HttpResponseBadRequest()
     else:
         response = get_response(request)
     if not isinstance(response, WSGIResponse)
         response = WSGIResponse(old=response)
     start_response(response.status_line, response.header)
     if not hasattr(response, "__iter__", False):
         return [become_unicode(response)]
     return become_unicode(response)
示例#2
0
 def __call__(self, raw_data):
     try:
         request = http.Request(raw_data)
     except:
         response = http.responses.error.HttpResponseBadRequest()
     else:
         response = get_response(request)
     return become_unicode(response.writable())
示例#3
0
 def __call__(self, raw_data):
     try:
         request = http.Request(raw_data)
     except:
         response = http.responses.error.HttpResponseBadRequest()
     else:
         response = get_response(request)
     return become_unicode(response.writable())