Compatibility with requests

Although we try our best to mimic the requests API, some functionality is not easy to implement and left out. Here are a list of known incompatibilities:

  • files API are slightly different, but more error-proof.

  • retries are not supported yet, tracked in [#24](https://github.com/lexiforest/curl_cffi/issues/24)

  • redirect response bodies are not retained in Response.history

  • empty-domains cookies may lost during redirects, tracked in [#55](https://github.com/lexiforest/curl_cffi/issues/55)

  • streaming response objects cannot be pickled; non-streaming responses can.

  • The requests proxies dict is supported, but we prefer proxy=..., unless you really use different proxies for http and https.

  • You can use use transports/adapters, instead, you can use curl_cffi as adapter for reuqests.

Transports and Adapters

curl_cffi is deeply coupled with libcurl-impersonate. Unlike requests or httpx, There is no way to use a different networking library or mount different adapters.

Alternatively, you can use curl-cffi as a requests adapter via curl-adapter. In this way, you get the full functionality of requests.