I'm using pycurl to access a JSON web API, but when I try to use the following:
ocurl.setopt(pycurl.URL, gaurl) # host + endpoint
ocurl.setopt(pycurl.RETURNTRANSFER, 1)
ocurl.setopt(pycurl.HTTPHEADER, gaheader) # Send extra headers
ocurl.setopt(pycurl.CUSTOMREQUEST, "POST") # HTTP POST req
ocurl.setopt(pycurl.CONNECTTIMEOUT, 2)
and execute the script, it fails.
File "getdata.py", line 46, in apicall
ocurl.setopt(pycurl.RETURNTRANSFER, 1)
AttributeError: 'module' object has no attribute 'RETURNTRANSFER'
I haven't a clue what's going on, and why RETURNTRANSFER doesn't appear to exist while all the other options do.