From c69527fe81396a6872d9fd4fff5b9e31b55bad65 Mon Sep 17 00:00:00 2001 From: Todd Jacobsen Date: Sat, 28 May 2022 14:32:11 -0600 Subject: [PATCH] Updates github example to use Authorization header (#53) see https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/#changes-to-make --- examples/github.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/github.py b/examples/github.py index 12a7edc..a9a4d31 100644 --- a/examples/github.py +++ b/examples/github.py @@ -18,8 +18,8 @@ class EventResource(Resource): # https://github.com/settings/tokens -default_params = {"access_token": "valid-token"} -github_api = API(api_root_url="https://api.github.com", params=default_params, json_encode_body=True) +headers = {"Authorization": "token valid-token"} +github_api = API(api_root_url="https://api.github.com", headers=headers, json_encode_body=True) github_api.add_resource(resource_name="events", resource_class=EventResource) print("github_api.events.public_events={!r}".format(github_api.events.public_events())) print(