Implements Window's WinINet API for python requests
Project description
requests-wininet
A transport adapter for Python's requests library that uses the Windows WinINet API. This allows Python HTTP(S) requests to leverage the same proxy, authentication, and network stack as Internet Explorer and other native Windows applications. This is designed for GUI applications that need to use the same client certificates and proxy settings as the user's Windows environment.
Features
- Seamless integration with the
requestslibrary - Provides integrated support for existing windows client certificates, similar to how Chrome and Edge handle them
- Drop-in replacement for the default
requeststransport adapter - Uses Windows WinINet for HTTP/HTTPS
- Supports system proxy settings and authentication dialogs
- Handles chunked transfer encoding and streaming responses
- Python 3.13+
Requirements
- Windows OS
- Python >= 3.13
requests >= 2.32.3, <3.0.0
Installation
pip install requests-wininet
Or with Poetry:
poetry add requests-wininet
Usage
import requests
from requests_wininet import WinINetAdapter
session = requests.Session()
session.mount("http://", WinINetAdapter())
session.mount("https://", WinINetAdapter())
response = session.get("https://example.com")
print(response.status_code)
print(response.headers)
print(response.text)
Development & Testing
- Clone the repository and install dependencies:
poetry install - Run tests:
poetry run pytest
- Run code coverage:
poetry run coverage run -m pytest poetry run coverage report
License
APACHE-2.0
Author
Curtis Ruck (ruckc@users.github.com)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file requests_wininet-0.1.6.tar.gz.
File metadata
- Download URL: requests_wininet-0.1.6.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Windows/2022Server
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6474ad2f0e4a11a77821967b1eb9e656f7ec4404a197ae454bbbca624a022684
|
|
| MD5 |
c1b40719f16f5e6fa2ad16a54532c54a
|
|
| BLAKE2b-256 |
a556b5ba6f8785128dd0d6bc0815fb1abc5a058313d05de40df36f1eb520b9bc
|
File details
Details for the file requests_wininet-0.1.6-py3-none-any.whl.
File metadata
- Download URL: requests_wininet-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Windows/2022Server
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc22c88f0493c4d421dc9b9a00ef7ad4cfd4f8d2ffa4e463e8d5783a68f97a77
|
|
| MD5 |
7933cc44bff090fae1cfe75848d32708
|
|
| BLAKE2b-256 |
115e7da957b9a2541c9ae162ffa65fa8c8bb9a75dca28d851e8266b465874546
|