tests/get-with-headers.py
branchstable
changeset 717 43efa35c5eed
parent 567 fd52c78e1aa7
child 1051 5b75af0ca224
equal deleted inserted replaced
716:409e8ba90661 717:43efa35c5eed
    20 for h in headers:
    20 for h in headers:
    21     if response.getheader(h, None) is not None:
    21     if response.getheader(h, None) is not None:
    22         print "%s: %s" % (h, response.getheader(h))
    22         print "%s: %s" % (h, response.getheader(h))
    23 print
    23 print
    24 data = response.read()
    24 data = response.read()
    25 data = re.sub('\d+ years', 'many years', data)
       
    26 sys.stdout.write(data)
    25 sys.stdout.write(data)
    27 
    26 
    28 if 200 <= response.status <= 299:
    27 if 200 <= response.status <= 299:
    29     sys.exit(0)
    28     sys.exit(0)
    30 sys.exit(1)
    29 sys.exit(1)