Skip to content

Allow to pass requests session #413

@northtree

Description

@northtree

Currently, some requests params could be passed thru requests_kwargs. However, it's still limited while we need to adapt requests session. For instance, session may required customized adapter for multi-threading, which's common requirement for calling googlemaps.

import requests.adapters

session = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100)
session.mount('http://', adapter)

Ref: https://stackoverflow.com/questions/18466079/can-i-change-the-connection-pool-size-for-pythons-requests-module

If it sounds good, I can have tiny PR for this issue.

Metadata

Metadata

Assignees

Labels

triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions