473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to use httplib module http authentication??

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

Jul 18 '05 #1
0 1882

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roger Binns | last post by:
I have just spent several weeks mashing xmlrpc, httplib and SSL (from M2Crypto) to work together. The current standard library has several problems: - Builtin SSL is pretty much useless if you...
2
by: scummer | last post by:
Hi, I am having a problem with the httplib HTTPConnection object. While I can easily send requests that don't have any payload (ie. "get"), I encounter issues if I want to post xml data. If you...
0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
2
by: James Stroud | last post by:
Hello All, I want to use python to download files from sites where authentication is required. The page appears to send a form with the login and pass by post. I would like to log in and keep...
0
by: Michael Oliver | last post by:
I am trying to write a Python client to access a Tomcat servlet using Tomcat Realm authentication with no success. I can use the httplib to connect to localhost port 8080 ok and post and get...
5
by: scott | last post by:
Hello, From a shell script, I have used /usr/bin/curl to access a web site and pass a cookie (as required by the site). But, I can't seem to accomplish this task with Python. I would like to...
5
by: runningwild | last post by:
Helo, This is the first time I have cared about httplib's HTTPSConnection. In the docs I read "Note: HTTPS support is only available if the socket module was compiled with SSL support." ...
11
by: Phoe6 | last post by:
Hi, The following piece of code works properly when my proxy password contains characters etc. But when my proxy password contained something like '|\/|' , the httplib incorrectly indentified it...
3
by: rhXX | last post by:
hi all, i'm using this tutorial example import httplib h = httplib.HTTP("www.python.org") h.putrequest('GET','/index.html') h.putheader('User-Agent','Lame Tutorial Code')...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.