Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2008

    httplib stuck on response

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

    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.

  2. #2
    Regular Contributor
    Join Date
    Jan 2008

    Re: httplib stuck on response

    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 ?

  3. #3
    Regular Contributor
    Join Date
    Jan 2008

    Re: httplib stuck on response

    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

Similar Threads

  1. Handling asynch USSD response from operator
    By espenwe in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2009-02-05, 08:46
  2. Problem retreiving custom HTTP response header
    By hmeet2 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-01-03, 09:35
  3. Nokia 30 response format
    By richard_h_t in forum Nokia M2M
    Replies: 0
    Last Post: 2005-07-06, 08:23
  4. 'Response Unknown' when downloading midlet
    By Weevil in forum Mobile Java General
    Replies: 3
    Last Post: 2004-05-30, 17:01
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

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