The requests.session() fucntion

Web services, particularly privately owned ones, are often password protected. Sometimes, this is done using the older HTTP digest authentication system, which we can address using the auth argument of the request functions. More commonly these days though, authentication involves posting credentials to a REST endpoint to obtain a session cookie or authentication token that is used to validate subsequent requests.

An endpoint is simply a URL that corresponds to data or functionality exposed by the API. Data is sent to or retrieved from an endpoint.

The requests method makes all of this simple by providing the Session class. A Session object allows you to persist settings, cookies, and connections across multiple ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.