Skip to content

A full integration with requests library #484

@el1s7

Description

@el1s7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions