tests/get-with-headers.py
branchstable
changeset 1297 60e578eae19d
parent 1201 6f2f7246e4be
equal deleted inserted replaced
1295:8e66ac9c0f0e 1297:60e578eae19d
    41     for h in [h.lower() for h in show]:
    41     for h in [h.lower() for h in show]:
    42         if response.getheader(h, None) is not None:
    42         if response.getheader(h, None) is not None:
    43             print "%s: %s" % (h, response.getheader(h))
    43             print "%s: %s" % (h, response.getheader(h))
    44     if not headeronly:
    44     if not headeronly:
    45         print
    45         print
    46         data = response.read()
    46         if response.status != 500:
    47         sys.stdout.write(data)
    47             data = response.read()
       
    48             sys.stdout.write(data)
    48 
    49 
    49         if twice and response.getheader('ETag', None):
    50         if twice and response.getheader('ETag', None):
    50             tag = response.getheader('ETag')
    51             tag = response.getheader('ETag')
    51 
    52 
    52     return response.status
    53     return response.status