tests/get-with-headers.py
changeset 1299 ce8024f27837
parent 1297 60e578eae19d
equal deleted inserted replaced
1296:115d2b6a8a9c 1299:ce8024f27837
    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