new httplib and 100 continue error

ftian at cs.wisc.edu ftian at cs.wisc.edu
Wed Aug 9 13:24:58 EDT 2000


Hi,

Thanks for the pointer, now I have got the new httplib (HTTP1.1)
running.

There is a problem, though.  When I connect to IIS, sometimes
IIS return an error code "100 continue".  response.read() will
return no data, and another http.getresponse() will raise exception.
How should a python program react to this?  A more general question,
if whenever exception happened during processing, should I always
call resp.read() so that I can get http back to "correct" state?

Thanks.

Feng

My code is sort of like
def doit():
    http.putrequest(...)
    .... headers
    http.send(body)

    resp = http.getresponse()
    
    errcode, errmsg, headers = resp.status, resp.reason, resp.msg
    if errcode == 100:  # ???
        page = resp.read() # no data
        resp = http.getresponse() # try to continue, exception here
    page = resp.read()







More information about the Python-list mailing list