Using python 2.7, I need to convert the following curl command to execute in python. 
curl -b /tmp/admin.cookie --cacert /some/cert/location/serverapache.crt --header "X-Requested-With: XMLHttpRequest" --request POST  "https://www.test.com"
I am relatively new to Python and are not sure how to use the urllib library or if I should use the requests library.  The curl options are especially tricky for me to convert. Any help will be appreciated.
Can you stay under command line ? 
If yes, try the python lib nammed "pexpect". It's pretty useful, and let you run commands like on a terminal, from a python program, and interact with the terminal !
curl and curl options to python conversion