You Are Here:

Community: Developer Discussion Boards

#1 Old httplib stuck on response - 2008-01-26, 20:18

Join Date: Jan 2008
Posts: 56
roidayan
Offline
Regular Contributor
hey
i tried using httplib as simple as just making a httplib.HTTPConnection and get a response
conn = httplib.HTTPConnection("location-server.com:80")
conn.request("POST", "/location", params, headers)
response = conn.getresponse()
data = response.read()
conn.close()

but it seems to get stuck and never get to conn.close() even.
i used appuifw.note before httpconnection and after close to check where i get stuck.
any idea?
according to n95 connection manager i see after few bytes its just hangs there.
Reply With Quote

#2 Old Re: httplib stuck on response - 2008-01-27, 22:11

Join Date: Jan 2008
Posts: 56
roidayan
Offline
Regular Contributor
it seems after few minutes of waiting i get timeout
and its strange since internet works fine for few from other apps.
any idea what it could be ? or what can i check ?
Reply With Quote

#3 Old Re: httplib stuck on response - 2008-01-28, 06:58

Join Date: Jan 2008
Posts: 56
roidayan
Offline
Regular Contributor
no one answered but i found something so i'll post an answer for those interested.

httplib and urllib cant use the wap access since its passing through a proxy. just call your operator and ask wap proxy details.

#example for using proxy with httplib
conn = httplib.HTTPConnection("proxy.com", 8080)
conn.request("GET", "http://www.python.org/")

#example for urllib
os.environ["http_proxy"] = "http://proxyserver:3128"
data = urllib.urlopen("http://server/page").read()

#example for sockets
HOST = 'proxy.com'
PORT = 81
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('GET http://www.python.org/ HTTP/1.1\r\nAccept: text/plain\r\n\r\n')
while 1:
data = s.recv(1024)
print data
if len(data) < 1024: break
s.close()
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling asynch USSD response from operator espenwe Symbian Networking & Messaging 9 2009-02-05 09:46
Problem retreiving custom HTTP response header hmeet2 Symbian Networking & Messaging 0 2007-01-03 10:35
Nokia 30 response format richard_h_t Nokia M2M 0 2005-07-06 09:23
'Response Unknown' when downloading midlet Weevil Mobile Java General 3 2004-05-30 18:01
nokia 7210 modem via IR doesn't work ! oussamaaiadi PC Suite API and PC Connectivity SDK 1 2003-03-06 11:46

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ