Python - Jira - REST Logn - 405 error

Modha K Khammammettu January 24, 2018

 

Hello

I am trying to login to Jira within python program and I get 405 error. Here is my code:

import httplib
import urllib
import json

conn = httplib.HTTPConnection("myjira:2002")
args = urllib.urlencode({'username':'myuser', 'password':'mypassword'})
headers = {'accept':'application/json'}
r1 = conn.request("post","/rest/auth/1/session",args, headers)

# --- Authenticate to jira ----------------
r2 = conn.getresponse()
print r1,r2.status,r2.reason,r2

 

The result I get

None 405 <httplib.HTTPResponse instance at 0x7fc1815b10e0>

Process finished with exit code 0

 

Can you please let me know why this code does not work.

I am using Jira 7.4.4

 

Thanks

Abe 

1 answer

0 votes
Modha K Khammammettu January 25, 2018

Any one done this?

Suggest an answer

Log in or Sign up to answer