Overview

Requests 2.28, released on June 30, 2022, adopts charset_normalizer as the default dependency replacing chardet.

Main Features

charset_normalizer default

charset_normalizer becomes the default dependency for encoding detection, offering better performance and an MIT license.

python
import requests

# charset_normalizer is used by default
r = requests.get('https://httpbin.org/html')
print(r.encoding)  # detected by charset_normalizer
print(r.text[:100])

Various improvements

Cookies and redirects are better handled, with security fixes for cross-origin redirect tracking.

python
import requests

# Improved session and cookie handling
session = requests.Session()
session.get('https://httpbin.org/cookies/set/token/abc123')
r = session.get('https://httpbin.org/cookies')
print(r.json())  # {'cookies': {'token': 'abc123'}}

Sources