Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 def request_callback(method, uri, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri)
Esempio n. 4
0
 def request_callback(method, uri, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri)
Esempio n. 5
0
 def request_callback(uri, method, body, headers):
     return "The {0} response from {1}".format(decode_utf8(method),
                                               uri.full_url())
Esempio n. 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)]
Esempio n. 7
0
 def request_callback(request, uri, headers):
     return [200, headers,"The {0} response from {1}".format(decode_utf8(request.method), uri)]
Esempio n. 8
0
 def request_callback(uri, method, body, headers):
     return "The {0} response from {1}".format(decode_utf8(method), uri.full_url())