Skip to content

hrequestsvshttpful

MIT 51 1 1,001
33.3 thousand (month) Feb 23 2022 0.9.2(2024-12-01 02:55:27 ago)
1,803 4 88 MIT
Apr 14 2012 5.5 thousand (month) 1.0.0(2024-05-01 11:33:16 ago)

hrequests is a feature rich modern replacement for a famous requests library for Python. It provides a feature rich HTTP client capable of resisting popular scraper identification techniques: - Seamless transition between headless browser and http client based requests - Integrated HTML parser - Mimicking of real browser TLS fingerprints - Javascript rendering - HTTP2 support - Realistic browser headers

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"

Highlights


bypasshttp2tls-fingerprinthttp-fingerprintsyncasync

Example Use


hrequests has almost identical API and UX as requests and here's a quick overview: ```python import hrequests # perform HTTP client requests resp = hrequests.get('https://httpbin.org/html') print(resp.status_code) # 200 # use headless browsers and sessions: session = hrequests.Session('chrome', version=122, os="mac") # supports asyncio and easy concurrency requests = [ hrequests.async_get('https://www.google.com/', browser='firefox'), hrequests.async_get('https://www.duckduckgo.com/'), hrequests.async_get('https://www.yahoo.com/'), hrequests.async_get('https://www.httpbin.org/'), ] responses = hrequests.map(requests, size=3) # max 3 conccurency ```
```javascript 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; ```

Alternatives / Similar


Was this page helpful?