Пример #1
0
    def request_callback(uri, method, body, headers):
        foo_header_regex = re.compile('X-foo: (.*?)\r\n')
        match = foo_header_regex.search(decode_utf8(headers))

        result = "Response from {0} with body:'{1}' and headers:'{2}'".format(
            uri.full_url(),
            decode_utf8(body),
            match.groups()[0],
        )
        return result
Пример #2
0
    def request_callback(uri, method, body, headers):
        foo_header_regex = re.compile('X-foo: (.*?)\r\n')
        match = foo_header_regex.search(decode_utf8(headers))

        result = "Response from {0} with body:'{1}' and headers:'{2}'".format(
            uri.full_url(),
            decode_utf8(body),
            match.groups()[0],
        )
        return result
Пример #3
0
 def request_callback(method, uri, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri)
Пример #4
0
 def request_callback(method, uri, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri)
Пример #5
0
 def request_callback(uri, method, body, headers):
     return "The {0} response from {1}".format(decode_utf8(method),
                                               uri.full_url())
Пример #6
0
 def request_callback(request, uri, headers):
     headers.update({'a':'b'})
     return [418,headers,"The {0} response from {1}".format(decode_utf8(request.method), uri)]
Пример #7
0
 def request_callback(request, uri, headers):
     return [200, headers,"The {0} response from {1}".format(decode_utf8(request.method), uri)]
Пример #8
0
 def request_callback(uri, method, body, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri.full_url())