This is a sample of an HTTP session with the Requests library Its intended use is to demonstrate an authenticated session with a REST API
I use this in an environment configured like this:
- Pyenv w/ Python >= 3.10
- Requests library installed via pip
- Certifi library installed via pip
CERT_PATH=`python -m certifi`
- edit
$CERT_PATH
to append local CA certificate export SSL_CERT_FILE={$CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
I will also typically install iPython to allow interactive queries of the API.