×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    1

    Problem with HTTPlib

    Hi guys!

    Code:
    import httplib, urllib
    
    msgvar = "themsg"
    numvar = "mynumber"
    params = urllib.urlencode({'nvar': numvar, 'mvar': msgvar})
    print params
    print "Completed encoding!"
    
    conn = httplib.HTTPConnection("www.mysite.com")
    print "Completed connection!"
    
    theurl="/tests/domypost.php?"+params
    print theurl
    
    conn.request("GET", theurl)
    
    print "Process Completed!"
    I ran this from my phone and it gets stuck at the line when the conn.request() is called. (I was able to figure that out by using the print statement after every process)

    I also installed Python version 2.2.2 on my comp (just to match the 2.2.2 on the phone). The code works fine on the comp. But gets stuck at the above said line when run on phone.

    Any idea what needs to be done to get this working?

    Info:
    • Nokia N70 Music Edtion
    • Pys60 1.4.2 for 2nd edition FP3
    • Tested dir(httplib), it seems to be fine
    • GPRS is working fine on Nokia browser and Opera Mini
    • I am inserting the sent values into a DB thru the php file. My DB is empty, so there seems to be a problem with connection.
    • I read on the forums that urllib is better than httplib but when I used urllib.request() it again gets stuck on my phone but works fine on comp


    --
    Wondering!

  2. #2
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: Problem with HTTPlib

    Quote Originally Posted by alphaLouis View Post
    Hi guys!
    I ran this from my phone and it gets stuck at the line when the conn.request() is called. (I was able to figure that out by using the print statement after every process)
    In phone, you need to select the access point prior using socket functions. See PyS60 API documentation regarding sockets. Maybe this was the cause.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    56

    Re: Problem with HTTPlib

    it you are trying to use the wap access point it wont work like this, you need to tell httpconnection the proxy of your operator access point and to request to send the url you want to retrieve with http:// in front.

    example:

    conn = httplib.HTTPConnection('proxyort')
    conn.request('GET', 'http://www.google.com', params, headers)

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Problem with HTTPlib

    hi alphalouis
    welcome to the python dibo. Plz have a look at this link you will get more information regarding your problem.
    plz feel free to give a feedback

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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