how to use httplib module http authentication??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leon

    #1

    how to use httplib module http authentication??

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

    source code....

    import httplib,threadi ng
    def waitSeconds():
    sResponse = httpClient.getr esponse()
    print sResponse.reaso n
    authHeader = {'Authorization ':'Basic TGVvbjoxMjM='}

    httpClient = httplib.HTTPCon nection('172.16 .66.116')

    httpClient.requ est('GET','/')
    sResponse = httpClient.getr esponse()
    httpClient.requ est('GET','/','',authHeader )
    runWait = threading.Timer (5,waitSeconds)
    runWait.start()



Working...