From 6bcc51080abb6c8b8bab60877aa5a272f08a1fab Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 19 Sep 2024 15:24:15 -0400 Subject: [PATCH] docs: update readme example --- README.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index c3c06de..916d6db 100644 --- a/README.rst +++ b/README.rst @@ -23,11 +23,12 @@ Interacting with a protected url, you can use the BakeryAuth provided to deal with the macaroon bakery >>> from macaroonbakery import httpbakery + >>> import requests >>> jar = requests.cookies.RequestsCookieJar() - >>> resp = requests.get('some protected url', - cookies=jar, - auth=httpbakery.BakeryAuth(cookies=jar)) - >>> resp.raise_for_status() + >>> client = httpbakery.Client(cookies=jar) + >>> client.request( + ... "GET", "https://api.staging.charmhub.io/v1/tokens/whoami" + ... ).json() You can use any cookie storage you'd like so next subsequent calls the macaroon