httpfulvscurl-impersonate
Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the features and flexibility to get the job done and make those features really easy to use.
Features
- Readable HTTP Method Support (GET, PUT, POST, DELETE, HEAD, PATCH and OPTIONS)
- Custom Headers
- Automatic "Smart" Parsing
- Automatic Payload Serialization
- Basic Auth
- Client Side Certificate Auth
- Request "Templates"
Curl-impersonate is a special build of libcurl
and cURL HTTP client that impersonates the four major browsers:
- Google Chrome
- Microsoft Edge
- Safari
- Firefox
Curl-impersonate achieves this by patching TLS and HTTP fingerprints to be identical to that of one of these real browsers.
Unlike other HTTP clients curl-impersonate can bypass TSL and HTTP fingerprinting and detection techniques though it does not implement anything for Javascript fingerprint or bypass.
Highlights
bypasshttp2tls-fingerprinthttp-fingerprintlow-level
Example Use
require 'vendor/autoload.php';
use Httpful\Request;
// make GET request
$response = \Httpful\Request::get("http://httpbin.org/get")
->send();
echo $response->body;
// make POST request
$data = array('name' => 'Bob', 'age' => 35);
$response = \Httpful\Request::post("http://httpbin.org/post")
->sendsJson()
->body(json_encode($data))
->send();
echo $response->body;
// add headers or cookies
$response = \Httpful\Request::get("http://httpbin.org/headers")
->addHeader("API-KEY", "mykey")
->addHeader("Cookie", "foo=bar")
->send();
echo $response->body;
curl-impersonate installs itself under `curl_` terminal commands like `curl_chrome116`:
To use it in HTTP client libraries that use `libcurl` replace curl path with one of these.
To use it in python directly see curl-cffi Python package
$ curl_chrome116 https://www.wikipedia.org