I am developing a front end for snap… I am trying to access the REST API via python requests but I keep getting a ConnectionRefusedError [Errno 111]
when executing the following code:
requests.get(“http://localhost:8181/v2/snaps”)
I assume this is because I haven’t authenticated with the rest API. When accessing the API via a terminal you can authenticate like so:
curl -L https://localhost:8181/v2/snaps -u
However, I cannot for the life of me figure out how to authenticate over python requests. I have dug around in both the requests documentation (which provides authentication protocols, but no relevant ones) and the snap REST API documentation (which does not provide the necessary examples in python for me to determine how I might go about authentication).
So, how on earth do I authenticate with the snap REST API over python requests?