0

I'm trying to get json from jira but all the time receive empty response. By the way from browser I get data well.

Here is my server code:

import pycurl
from StringIO import StringIO

c = pycurl.Curl()
buffer = StringIO()
c.setopt(c.URL, 'https://jirawebsite.com/file.json')
c.setopt(c.HTTPAUTH, c.HTTPAUTH_BASIC)
c.setopt(c.USERPWD, 'user:pass')
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()

Yes, status code is 200. Response cookie contain HttpOnly (don't know if it's important)

2 Answers2

0

I would advise you to use the Python Library for Jira, will make your life a lot easier!

Python library for interacting with JIRA via REST APIs.

Also, consuming any REST from Python the Requests library is a lot more simple to work with.

Requests: HTTP for Humans

StefanE
  • 7,578
  • 10
  • 48
  • 75
0

I advise against using Requests due to it having a major bug with verifying security so if this is only for jira, maybe, but if you're going to continue to develop scripts for anything else then Requests completely fails.

  • Can you add more details by referencing relevant links etc., Your answer is more likely to attract downvotes. Refer https://stackoverflow.com/help/how-to-answer to write good answers – harshavmb Jun 02 '17 at 04:16