High Performance HTTP Requests Library
Project description
FiberHTTP
FiberHTTP
High Performance HTTP Requests Library
The benchmarks folder contains comparisons between FiberHTTP
and other well-known libraries such as requests
, httpx
, http.client
, and others. You will notice that FiberHTTP
outperforms them every time
Fiberhttp might not for you
Fiberhttp is designed to provide high performance but lacks many features like:
missing Features:
- No Support streaming requests
- No Support redirects requests
- No Support compressed requests
- No Support chunked requests
All these features are not supported by the library for the purpose of improving performance.
If these features are important to you, and you value compatibility and functionality over performance, then the requests library might be a better choice for you.
Features:
- Keep-alive (socket connection)
- Upload & Download Multi Files
- Prepare bytes request before send
- Create Connection with server before send the request
- High-performance SSL/TLS handshake, verify
- Reading responses in various formats such as JSON, headers, Cookies
Benchmarks
Benchmarks Codes: benchmarks
Library | Results (Lower is Better) |
---|---|
FiberHTTP | 1,000,000 HTTP Requests in 18 SEC'S |
http.client | 1,000,000 HTTP Requests in 92 SEC'S |
AIOHTTP | 1,000,000 HTTP Requests in 162 SEC'S |
urllib3 | 1,000,000 HTTP Requests in 221 SEC'S |
HTTPX | 1,000,000 HTTP Requests in 332 SEC'S |
HTTPX-ASYNC | 1,000,000 HTTP Requests in 427 SEC'S |
requests | 1,000,000 HTTP Requests in 472 SEC'S |
How to use
install Fiberhttp (supported all os systems)
pip install fiberhttp
with client session
import fiberhttp
# create client session with timeout
# ! timeout arg not requierd
cn = fiberhttp.Client(timeout=10)
# send get request
res = cn.get('https://httpbin.org/ip')
status_code = res.status_code()
body = res.text()
headers = res.headers()['Date']
json = res.json()['origin']
without client session
import fiberhttp
# send request without create client
response = fiberhttp.get('https://httpbin.org/ip')
with proxies
import fiberhttp
# create client proxy
cn = fiberhttp.Client_Proxy('http://20.111.54.16:8123')
# send request after the proxy in the client session
response = cn.get('https://httpbin.org/ip').json()['origin']
print(response)
use prepare request to get high performance
import fiberhttp
cn = fiberhttp.Client()
# prepare request with this format
request = fiberhttp.Request('GET', 'https://httpbin.org/ip')
# send request after prepare it
response = cn.send(request).json()
create connection with host before send request to reduce response time
import fiberhttp
cn = fiberhttp.Client()
request = fiberhttp.Request('GET', 'https://httpbin.org/ip')
# create connection with host
cn.connect('httpbin.org')
response = cn.send(request).text()
print(response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fiberhttp-5.2.tar.gz
.
File metadata
- Download URL: fiberhttp-5.2.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5801df6ade10193995d8c3cb67dd9d05c89548fa695dd7c2fd4988fe76ef216 |
|
MD5 | 2541d729314317b343c5f6d704e6865b |
|
BLAKE2b-256 | 811f40279ffee9cde786a54cc8daa040a9e3e286aba0c411c04778e32ba22ab2 |
File details
Details for the file fiberhttp-5.2-py3-none-any.whl
.
File metadata
- Download URL: fiberhttp-5.2-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfce62644314c2cafef18e8bba824c6587ce177c3c6165aac99ec8b1d795d9e4 |
|
MD5 | e314a312ee979050ef0c0190d8e99213 |
|
BLAKE2b-256 | 987b0b71b3e50bdcb256b81677b512dcb6c904e40a79e4f8158bf04aee0f405c |