jira rest api - Hit http url using python getting IOError -
i tried hitting below
import urllib second_query="http://example.com" pw = urllib.urlopen(second_query) pw = pw.read() print pw
i trying hit jira api -http://example.com getting following error
traceback (most recent call last): file "abc.py", line 7, in <module> pw = urllib.urlopen(second_query) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 87, in urlopen return opener.open(url) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 203, in open return getattr(self, name)(url) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 358, in open_http return self.http_error(url, fp, errcode, errmsg, headers) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 371, in http_error result = method(url, fp, errcode, errmsg, headers) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 683, in http_error_401 errcode, errmsg, headers) file "/abc/xyz/pqr/thirdparty/python/2.6/lib/python2.6/urllib.py", line 381, in http_error_default raise ioerror, ('http error', errcode, errmsg, headers) ioerror: ('http error', 401, 'unauthorized', <httplib.httpmessage instance @ 0x138e26c8>)
please suggest solution.
by reading error it's clear don't have required authorization:
ioerror: ('http error', 401, 'unauthorized', <httplib.httpmessage instance @ 0x138e26c8>
you have somehow provide necessary credentials... i'm quite sure jira provides high level api use tools, don't have use low level approach.
Comments
Post a Comment