requests python encoding utf-8 code example
Example 1: python open encoding utf-8
from io import open
f = open("test", mode="r", encoding="utf-8")
Example 2: python requests header
url = 'https://api.github.com/some/endpoint'
headers = {'user-agent': 'my-app/0.0.1'}
r = requests.get(url, headers=headers)