I am trying to access a Mindtouch Wiki using Python. I am trying to use pycurl to do this as the sparse Mindtouch documentation does give CURL command line examples. I found by trial and error that the operation needs the --http1.0 option to be put n the CURL command line in order for the operation to succeed. However I have not found out how to set this option in pycurl.
What I get is:
c.setopt(c.HTTP_VERSION_1_0, True)
AttributeError: trying to obtain a non-existing attribute
When using CURL on the command line I use a hand coded XML file and refer to it using the -T option. However it would be easier to start with the XML as a string. Any additional insight into doing that in pycurl would be great.
Alternatively, if there is a better way of doing it than pycurl I would be happy to hear of it.
As an alternative to pycurl, you could try the
requests
HTTP library.Here's a working example that gets the JSON output of a specific page.
This gets the page endpoint for MindTouch's API calls article.
You can also include credentials, like so: