tests/get-with-headers.py
branchstable
changeset 23409 dc4d2cd3aa3e
parent 19865 ba6577a19656
child 24543 747401086a38
equal deleted inserted replaced
23403:edf29f9c15f0 23409:dc4d2cd3aa3e
    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         if response.status != 500:
    46         data = response.read()
    47             data = response.read()
    47         sys.stdout.write(data)
    48             sys.stdout.write(data)
       
    49 
    48 
    50         if twice and response.getheader('ETag', None):
    49         if twice and response.getheader('ETag', None):
    51             tag = response.getheader('ETag')
    50             tag = response.getheader('ETag')
    52 
    51 
    53     return response.status
    52     return response.status