tests/get-with-headers.py
branchstable
changeset 514 06b69a53ab0f
parent 513 90b51a0fe1f0
child 515 9ea5ac3258b6
equal deleted inserted replaced
513:90b51a0fe1f0 514:06b69a53ab0f
    12 for h in headers:
    12 for h in headers:
    13     if response.getheader(h, None) is not None:
    13     if response.getheader(h, None) is not None:
    14         print "%s: %s" % (h, response.getheader(h))
    14         print "%s: %s" % (h, response.getheader(h))
    15 print
    15 print
    16 sys.stdout.write(response.read())
    16 sys.stdout.write(response.read())
       
    17 
       
    18 if 200 <= response.status <= 299:
       
    19     sys.exit(0)
       
    20 sys.exit(1)