I’m trying to create a python script that logs into JIRA using their REST api. To do this I need to POST a login form (with the username and password) to the JIRA server and store the cookie that is retrieved (preferably as a field in a file).
Here’s the login docs:
http://confluence.atlassian.com/display/JIRA042/JIRA+REST+API+(Alpha)+Tutorial#JIRARESTAPIAlphaTutorial-LoggingIn
This is a working curl command to do exactly what I want:
curl -c cookie_jar -H "Content-Type: application/json" -d '{"username" : "admin", "password" : "hunter2"}' http://localhost:8080/rest/auth/latest/session
How can I replicate this in Python? Preferably without any extra libraries.
You should use LWPCookieJar