Skip to content

Commit

Permalink
README: update Key Features section
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed Apr 25, 2024
1 parent 8fb94b9 commit 339110c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 339110c

Please sign in to comment.