Skip to main content

Implements Window's WinINet API for python requests

Project description

requests-wininet

PyPI version

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 requests library
  • Provides integrated support for existing windows client certificates, similar to how Chrome and Edge handle them
  • Drop-in replacement for the default requests transport 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

requests_wininet-0.1.4.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requests_wininet-0.1.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file requests_wininet-0.1.4.tar.gz.

File metadata

  • Download URL: requests_wininet-0.1.4.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Windows/2022Server

File hashes

Hashes for requests_wininet-0.1.4.tar.gz
Algorithm Hash digest
SHA256 87c510e0d13b8f5790f3f5a14cf40d8051c7d5de046848b5c567b5dbc1df0edc
MD5 e82f04cdaa1f69115b3544833d4cb1b6
BLAKE2b-256 d4ecd1ecefcade156ee02199f60290457fa7007f0ba54990251c35fdfbd99ce6

See more details on using hashes here.

File details

Details for the file requests_wininet-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: requests_wininet-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Windows/2022Server

File hashes

Hashes for requests_wininet-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2289f277f7711e0eb5dba5104276bd183e56dd2678e73cf6eeea9f4fbb68120e
MD5 aa133e9c7cad8238685463b9ce106d23
BLAKE2b-256 6cc8e758b4876bc4789df0379475c81c0425c2b89426ba7bc1b5f7ab56209c2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page