From 5fe0c20c00eef7e7afcd8b9f9031a1398739e35c Mon Sep 17 00:00:00 2001 From: kalekale Date: Sat, 16 Jan 2021 21:46:40 +0545 Subject: [PATCH 1/2] added python3 example to authorization-code-grant.md added python3 example to authorization-code-grant.md --- book/overview/oauth/authorization-code-grant.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/book/overview/oauth/authorization-code-grant.md b/book/overview/oauth/authorization-code-grant.md index 77c6242..1bce85a 100644 --- a/book/overview/oauth/authorization-code-grant.md +++ b/book/overview/oauth/authorization-code-grant.md @@ -134,5 +134,19 @@ $response = $http->request('POST', 'https://graphql.anilist.co', [ ]); ``` {% endtab %} + +{% tab title="Python3" %} +```py +import requests + +headers = { + 'Authorization': 'Bearer ' + accessToken, + 'Content-Type': 'application/json', + 'Accept': 'application/json' +} +url = 'https://graphql.anilist.co' + +response = requests.post(url, json={'query': query, 'variables': variables}, headers=headers) +``` {% endtabs %} From 5be3910679854078d0516373096e90662793a7d0 Mon Sep 17 00:00:00 2001 From: kalekale Date: Sat, 16 Jan 2021 21:50:52 +0545 Subject: [PATCH 2/2] fix --- book/overview/oauth/authorization-code-grant.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/overview/oauth/authorization-code-grant.md b/book/overview/oauth/authorization-code-grant.md index 1bce85a..7859225 100644 --- a/book/overview/oauth/authorization-code-grant.md +++ b/book/overview/oauth/authorization-code-grant.md @@ -148,5 +148,5 @@ url = 'https://graphql.anilist.co' response = requests.post(url, json={'query': query, 'variables': variables}, headers=headers) ``` -{% endtabs %} +{% endtab %} {% endtabs %}