Repository navigation
impit-python@0.9.3
Changelog
All notable changes to this project will be documented in this file.
py-0.9.2 - 2025-11-13
Bug Fixes
- Treat unexpected EOF error as
RemoteProtocolError(#314)- Related to apify/apify-sdk-python#672
py-0.9.1 - 2025-11-13
Bug Fixes
- Raise Python exception on response body read error (#313)
- Originally, Python Impit bindings would return a response with an empty body on a body read error. This didn't make much sense and caused issues in the downstream dependencies. Now we rethrow the error so it can be properly handled. Closes apify/apify-sdk-python#672
py-0.9.0 - 2025-11-11
Bug Fixes
- Align anonymous client API with httpx (#310)
Refactor
- Introduce
ImpitRequeststruct for storing all request-related data (#307)- Refactors the
impit.make_requestmethod by splitting it intobuild_requestandsend. Prerequisite for the solution to #227 proposed in #227 (comment)
- Refactors the
py-0.8.0 - 2025-10-22
Features
- Add support for Python 3.14, drop support for Python 3.9 and PyPy (#289)
py-0.7.3 - 2025-10-17
Bug Fixes
- Do not panic on constructor param errors (#285)
- Introduces better error handling for constructor parameter errors.
Features
- Add
json()method forResponseobject (#277)- Adds a
Response.json()method that parsesResponse.textusing the nativejsonmodule.
- Adds a
py-0.6.1 - 2025-09-03
Features
- Include error message in
ConnectError(#258)- Injects
causeto theConnectErrordisplay string. This allows for better error introspection in dependent packages. Unblocks apify/crawlee-python#1389
- Injects
py-0.6.0 - 2025-09-02
Bug Fixes
- Fallback to HTTP/2 on HTTP3 DNS error (#255)
- Makes DNS client in HTTP/3 record resolution optional. If the initial connection fails with
Error, impit will returnfalsefor every call tohost_supports_h3(unless, e.g.alt-svcheader has been registered for this domain).
- Makes DNS client in HTTP/3 record resolution optional. If the initial connection fails with
Features
- Add
local_addressoption toImpitconstructor (#225)- Adds a
local_addressoption to the Impit HTTP client constructor across all language bindings (Rust, Python, and Node.js), allowing users to bind the client to a specific network interface. This feature is useful for testing purposes or when working with multiple network interfaces.
- Adds a
py-0.5.4 - 2025-08-26
Features
- Improve error typing for certain HTTP errors (#250)
- Improves error typing (mostly for Python version) on HTTP (network / server) errors and aligns the behaviour with HTTPX.
py-0.5.3 - 2025-08-13
Bug Fixes
- Allow passing request body in all HTTP methods except
TRACE(#238)
py-0.5.2 - 2025-08-11
Bug Fixes
- Resolve blocking behavior in synchronous
Clientwhile reading response (#234)-
- Resolve blocking behavior for read stream
Responseforimpit.Client
- Resolve blocking behavior for read stream
-
Features
- Add constructor for
Response(#233)-
- Add constructor for
Response. This can be useful when creating tests and mocks. - Allow to set custom attributes inResponse---------
- Add constructor for
-
py-0.5.1 - 2025-08-05
Bug Fixes
- Resolve blocking behavior in
impit.Clientduring multithreaded operations (#230)
py-0.5.0 - 2025-07-30
Bug Fixes
- Log correct timeout duration on
TimeoutException(#222)- Logs the default
Impit-instance-wide timeout if the request-specific timeout is missing.
- Logs the default
py-0.4.1 - 2025-07-22
Bug Fixes
-
Exception class types are inheriting from
Exception(#207) -
Fix cookies with attributes 'SameSite' and
domain(#213)
Refactor
- Improve thread safety, make
ImpitSync(#212)
py-0.4.0 - 2025-07-07
Bug Fixes
- Fix the data types for
restandversionwith which theCookieobject is created. (#202)- Fix the data types with which a
Cookieobject is created, such asrestandversion.
- Fix the data types with which a
Features
- Add
(Async)Client.stream()method for Python (#201)- Adds
streamsupport forClientandAsyncClient. Implements forResponsesupport for thereadanditer_bytesmethods, and their counterpartsareadandaiter_bytesaccording to thehttpxAPI closes #142
- Adds
py-0.3.0 - 2025-06-25
Features
-
Add support for custom cookie store implementations (#179)
- Allows to pass custom cookie store implementations to the
ImpitBuilderstruct (using the newwith_cookie_storebuilder method). Without passing the store implementation,impitclient in both bindings is by default stateless (doesn't store cookies). Enables implementing custom support for language-specific cookie stores (in JS and Python).
- Allows to pass custom cookie store implementations to the
-
Show the underlying
reqwesterror on unrecognized error type (#183)- Improve error logs in bindings by tunneling the lower-level
reqwesterrors through to binding users.
- Improve error logs in bindings by tunneling the lower-level
-
Support
socksproxy (#197)- Enables support for
socksproxies toimpit-node. This theoretically enablessocksproxies for CLI and the Python binding as well, but this behaviour is untested due to a lack of working socks proxy server implementations in Python.
- Enables support for
-
Support for custom cookie stores for Python (#182)
- Adds
cookie_jarconstructor parameter forClientandAsyncClientclasses, acceptinghttp.cookiejar'sCookieJar(or a custom implementation thereof, implementing at leastsetCookie(cookie: http.cookiejar.Cookie)anditer(): Cookie[]. impit will write to and read from this custom cookie store. Related to #123
- Adds
-
Client-scoped
headersoption (#200)- Adds
headerssetting toImpitconstructor to set headers to be included in every request made by the built [Impit] instance. This can be used to add e.g. custom user-agent or authorization headers that should be included in every request. These headers override the "impersonation" headers set by thewith_browsermethod. In turn, these are overridden by request-specificheaderssetting.
- Adds
py-0.2.3 - 2025-05-09
Features
- Add context manager interface for
ClientandAsyncClient(#176)- Enables using
AsyncClientandClientconstructors as context managers inside thewith statements. Closes #174
- Enables using
py-0.2.2 - 2025-05-07
Bug Fixes
-
Reenable HTTP/3 features in JS bindings (#57)
- Recent package updates might have broken the
http3feature in Node.JS bindings. This PR solves the underlying problems by building the reqwest'sClientfrom within thenapi-rs-managedtokioruntime. Adds tests forhttp3usage from Node bindings. Removes problematic Firefox header (Connectionis not allowed in HTTP2 and HTTP3 requests or responses and together withforceHttp3was causing panics inside the Rust code).
- Recent package updates might have broken the
-
response.encodingcontains the actual encoding (#119)- Parses the
content-typeheader for thecharsetparameter.
- Parses the
-
Case-insensitive request header deduplication (#127)
- Refactors and simplifies the custom header logic. Custom headers now override "impersonated" browser headers regardless on the (upper|lower)case.
Features
-
Add
ReadableStreaminResponse.body(#28)- Accessing
Response.bodynow returns an instance of JSReadableStream. This API design matches the (browser) Fetch API spec. In order to correctly manage theResponseconsumption, the current codebase has been slightly refactored. Note that the implementation relies on a prerelease version of thenapi-rstooling.
- Accessing
-
Add Python bindings for
impit(#49)- Adds Python bindings for
impit. The interface is inspired by thehttpxlibrary (in the same way the JS bindings' interface is inspired byfetch, i.e. the end goal is to provide an almost drop-in replacement with extra features).
- Adds Python bindings for
-
Use
thiserrorfor better error handling DX (#90)- Adds
std::error::Errorimplementation withthiserror. This should improve the developer experience and error messages across the monorepo.
- Adds
-
Allow passing binary body to the
dataparameter (#103)- Following the discussion under #97 , this PR widens the type accepted by the
dataparameter.datanow accepts both adict[str,str]and a binary representation of the request body. This PR intentionally doesn't update the recently added typings in theimpit.pyifile, as this behaviour (accepting the binary body) is considered deprecated in thehttpxlibrary we use as the design master.
- Following the discussion under #97 , this PR widens the type accepted by the
-
Make
ImpitPyResponsepublic for Python with the nameResponse(#110)-
- Make
ImpitPyResponsepublic for Python with the nameResponse. This will improve type handling and code navigation in the IDE ---------
- Make
-
-
Add
urlandcontentproperty forResponse, smart.textdecoding, options for redirects (#122)- Adds
url,encodingandcontentproperties forResponse. Decodes the response using the automatic encoding-determining algorithm. Adds redirect-related options. ---------
- Adds
-
response.headersis aHeadersobject (#137)- Turns the
response.headersfrom aRecord<string, string>into aHeadersobject, matching the originalfetchAPI.
- Turns the
-
Better errors (#150)
- Improves the error handling in
impitand both the language bindings. Improves error messages. For Python bindings, this PR adds the same exception types as inhttpx.
- Improves the error handling in
-
Switch to
Vec<(String, String)>for request headers (#156)- Allows sending multiple request headers of the same name across all bindings / tools. Broadens the
RequestInit.headerstype in theimpit-nodebindings. Closes #151
- Allows sending multiple request headers of the same name across all bindings / tools. Broadens the
0.1.5 - 2025-01-23
Bug Fixes
- Use replacement character on invalid decode (#25)
- When decoding incorrectly encoded content, the binding now panics and takes down the entire JS script. This change replaces the incorrect sequence with the U+FFFD replacement character (�) in the content. This is most often the desired behaviour.