how to use httplib module http authentication??

Leon square690410 at yahoo.com.tw
Tue Nov 2 06:33:40 EST 2004


I use sniffer look,it's status is 200,but run getresponse() can occur error 
ResponseNotReady
I try wait it by 5 seconds,but still occur error ResponseNotReady

source code....

import httplib,threading
def waitSeconds():
    sResponse = httpClient.getresponse()
    print sResponse.reason
authHeader = {'Authorization':'Basic TGVvbjoxMjM='}

httpClient = httplib.HTTPConnection('172.16.66.116')

httpClient.request('GET','/')
sResponse = httpClient.getresponse()
httpClient.request('GET','/','',authHeader)
runWait = threading.Timer(5,waitSeconds)
runWait.start()






More information about the Python-list mailing list