how to use httplib module http authentication??

L

Leon

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,186
Latest member
vinaykumar_nevatia

Latest Threads

Top