Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A full integration with requests library #484

Open
el1s7 opened this issue Jan 21, 2025 · 1 comment
Open

A full integration with requests library #484

el1s7 opened this issue Jan 21, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@el1s7
Copy link

el1s7 commented Jan 21, 2025

I have made a module that can be plugged directly into the requests library, it replaces the default urllib3 HTTPAdapter with a custom adapter made to work with curl. You can check it out here https://github.com/el1s7/curl-adapter.

Here's how easy you can integrate curl_cffi to requests by using the curl-adapter module:

import requests
from curl_adapter import CurlCffiAdapter

with requests.Session() as s:
    s.mount("http://", CurlCffiAdapter(impersonate_browser_type="chrome"))
    s.mount("https://", CurlCffiAdapter(impersonate_browser_type="chrome"))

    response = s.get("https://example.com")

Even though you already have a pretty good cIient similar to requests, the curl-adapter module is useful for people who need a fully compatible requests API.

Doesn't have issues such as #438, #368, #208, #82, etc.

@el1s7 el1s7 added the enhancement New feature or request label Jan 21, 2025
@lexiforest
Copy link
Owner

lexiforest commented Jan 22, 2025

Thanks, I will create a section in the docs on your lib and similar ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants