⚡ Solution Summary
- Change the default HTTP client to prioritize requests over urlfetch.
- Ensure the environment is correctly set for Google App Engine.
- Review usage of urlfetch in testing environments.
### Describe the bug
_http_client.py [declares](https://github.com/stripe/stripe-python/blob/master/stripe/_http_client.py#L42-L45) that "Requests is the preferred HTTP library"; however, urlfetch is chosen before requests when creating a default http client.
Additionally, the current ordering throws an error when `appengine-python-standard` is installed.
### To Reproduce
1. `pip install appengine-python-standard`
2. `pip install stripe`
3. Initialize stripe client
```python
# Set your secret key. Remember to switch to your live secret key in production.
# See your keys here: https://dashboard.stripe.com/apikeys
stripe.api_key = '<your-api-key-here>'
```
5. Create a verification session
```python
verification_session = stripe.identity.VerificationSession.create(
type="document",
)
```
6. Error `AssertionError: No api proxy found for service "urlfetch"`
### Expected behavior
requests is chosen over urlfetch as default HTTP library.
### Code snippets
_No response_
### OS
macOS
### Language version
Python 3.12.4
### Library version
10.8.0
### API version
2024-06-20
### Additional context
[PR #1378 ](https://github.com/stripe/stripe-python/pull/1378)
Discussion & Fixes