diff --git a/README.md b/README.md index ab34cdb..d18a0f1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ pip install -U pyreqwest_impersonate ``` ## Key Features - +- `Impersonate`: The `Client` offers an `impersonate` option, enabling it to mimic web browsers by replicating their headers and `TLS/JA3/JA4/HTTP2` fingerprints. This feature is crucial for avoiding detection as a bot and potential blocking by websites. +- `Thread-safe`: The `Client` is designed to be thread-safe, allowing it to be safely used in multithreaded environments. - `High Performance`: The attributes of the `Response` object are executed in Rust, which is known for its high performance. This ensures that operations like accessing headers, decoding text, or parsing JSON are very fast. - `Lazy Execution`: All attributes of the `Response` object are executed lazily. This means that the actual computation or data retrieval happens only when you access the attribute, not when the `Response` object is created. - `Automatic Character Encoding Detection`: The `Response` object intelligently detects the character encoding of the response body from the "Content-Type" header. If the encoding is not specified, it defaults to "UTF-8". @@ -36,7 +37,7 @@ pip install -U pyreqwest_impersonate ### I. Client HTTP client that can impersonate web browsers. -```python3 +```python class Client: """Initializes an HTTP client that can impersonate web browsers. @@ -69,9 +70,9 @@ class Client: #### Client Methods The `Client` class provides a set of methods for making HTTP requests: `get`, `head`, `options`, `delete`, `post`, `put`, `patch`, each of which internally utilizes the `request()` method for execution. The parameters for these methods closely resemble those in `httpx`. -```python3 +```python def get(url, *, params=None, headers=None, auth=None, auth_bearer=None, timeout=None) - """Performs a GET request to the specified URL.""" + """Performs a GET request to the specified URL. Args: url (str): The URL to which the request will be made. @@ -81,10 +82,11 @@ def get(url, *, params=None, headers=None, auth=None, auth_bearer=None, timeout= for basic authentication. Default is None. auth_bearer (Optional[str]): A string representing the bearer token for bearer token authentication. Default is None. timeout (Optional[float]): The timeout for the request in seconds. Default is 30. + """ ``` ```python def post(url, *, params=None, headers=None, content=None, data=None, files=None, auth=None, auth_bearer=None, timeout=None) - """Performs a POST request to the specified URL.""" + """Performs a POST request to the specified URL. Args: url (str): The URL to which the request will be made. @@ -97,6 +99,7 @@ def post(url, *, params=None, headers=None, content=None, data=None, files=None, for basic authentication. Default is None. auth_bearer (Optional[str]): A string representing the bearer token for bearer token authentication. Default is None. timeout (Optional[float]): The timeout for the request in seconds. Default is 30. + """ ``` #### Example