Download the PHP package hamaadraza/php-impersonate without Composer
On this page you can find all versions of the php package hamaadraza/php-impersonate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hamaadraza/php-impersonate
More information about hamaadraza/php-impersonate
Files in hamaadraza/php-impersonate
Package php-impersonate
Short Description A PHP library for making HTTP requests with browser impersonation
License MIT
Homepage https://github.com/hamaadraza/php-impersonate
Informations about the package php-impersonate
PHP-Impersonate
A PHP library for making HTTP requests with browser impersonation. This library uses curl-impersonate to mimic various browsers' network signatures, making it useful for accessing websites that may detect and block automated requests.
Platform Requirements
IMPORTANT: This package only works on Linux platforms. Windows and macOS are not supported due to the reliance on Linux-specific binary dependencies.
Installation
Install via Composer:
System Requirements
- PHP 8.0 or higher
- Linux operating system
Basic Usage
API Reference
Static Methods
The library provides convenient static methods for making requests:
Instance Methods
You can also create an instance of the client for more configuration options:
Response Methods
The Response
class provides several methods for working with HTTP responses:
Browser Options
PHP-Impersonate supports mimicking various browsers:
chrome99_android
(default)chrome99
chrome100
chrome101
chrome104
chrome107
chrome110
chrome116
edge99
edge101
ff91esr
ff95
ff98
ff100
ff102
ff109
ff117
safari15_3
safari15_5
Example:
Timeouts
You can configure request timeouts:
Advanced Examples
JSON API Request
Error Handling
Testing
Run the test suite:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Data Formats for POST, PUT and PATCH Requests
PHP-Impersonate supports sending data in different formats:
Form Data
By default, data is sent as form data (application/x-www-form-urlencoded
):
JSON Data
You can send data as JSON by specifying the Content-Type
header:
For PUT and PATCH requests, JSON is used as the default format.