curl-and-python

help to Converting Curl to PyCurl code

From: Mohan L <l.mohanphy_at_gmail.com>
Date: Sun, 19 Dec 2010 22:20:25 +0530

Dear All,

I am new to Pycurl. I am unable to find good doc in the internet to start it
myself. I need some one help to getting start Pycurl.

I have user name and password for my site. I need to login the site using
username and password using Pycurl. Then I need to send the request to
server and the server will send the xml file as response. I am doing this
like this in Curl. I am sending the username and password in in one curl
call, it return "JSESSIONID" id. I am using the session id in the below
command to fetch the xml data from server.

curl -d "command=listCapacity&zoneId=1&podId=1" -X POST -b
"JSESSIONID=webD~C" https://manage.com:443/client/api -k > out.xml

running the above command in command line gives the xml file as output. I
want to convert this using Pycurl code so that it will be easy to parse the
xml from Python.

I need some code clue to achieve the above. Any help will be really
appreciated. I could be very nice some code and explanation of the code, so
that I will try to learn myself further.

Thanks For Your Time.

- LM

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2010-12-19