Back to Browse

Part 20 : Real time Example Github Rest API - Authenticate User using Python Requests Library Vscode

672 views
Jun 22, 2024
6:03

Part 20 : Generate Rest API Token And Authenticate User using Python Requests Library Vscode import requests import json import tokenVal #2 steps #generate token to access GutHub #hit Rest API to authenticate user token=tokenVal.getTokenVal() session=requests.session() url='https://api.github.com/user' headers={ "Authorization": f"Bearer {token}" } response=session.get(url=url, verify=False, headers=headers, ) responseCode=response.status_code print(responseCode) assert responseCode==200 print(response.json()) session.post()

Download

1 formats

Video Formats

360pmp48.9 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Part 20 : Real time Example Github Rest API - Authenticate User using Python Requests Library Vscode | NatokHD