0

Right now when I'm writing my code my pycurl response returns my json information but its just showing as one string instead of returning it formatted. I'd like it to format but everything I've tried seems to fail on every front.

import pycurl                                   
from StringIO import StringIO                   
try:                                            
    from io import BytesIO                      
except ImportError:                             
    from StringIO import StringIO as BytesIO    

data = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, fullurl)
c.setopt(pycurl.HTTPHEADER, [Api_info_a:Api_infoB])
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
c.perform()

print data()

Is there something in pycurl that formats this properly that I'm possibly missing? I've tried pprint, dumping it into json and making it a json.dumps when I print out and each time I get one long string. I've also attempted to add separator values and that has also failed.

Any help would be great thanks!

  • Where do you get / store the actual result from `c`? – Klaus D. Jun 02 '17 at 02:26
  • @Klaus D. C is is just `c = pycurl.Curl()` Its used to invoke myself setting the options within pycurl like setting debug, or where I'm writing things. I've excluded the variables for lack of necessity. since they are just string values. – pycurlguy Jun 02 '17 at 13:58

0 Answers0