fetch_many(base_url, ids) creating one requests.Session (in a with block), setting a shared header {'X-Client': 'datavix'} on it, and GETting /items/<id> for each id — returning the list of parsed bodies. The session pools connections across calls.fetch_many(url, [1, 2, 3])
three parsed bodies over one pooled connection
Session headers apply to every request it makes.
with requests.Session() as s:.
s.headers.update({...}) once.