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
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.1.0.tar.gz
.
File metadata
- Download URL: fiberhttp-5.1.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d313d8b008c4e6f98d08b0def91793a5fb1f5a1c58796dffda223f9b088b8f83 |
|
MD5 | 23bb7a7e54343e61c2b098e488465ee7 |
|
BLAKE2b-256 | 70aeca7c928906f25526ed2c5d0b08525b5997a3b93fd23ab896afb942e35e6f |
File details
Details for the file fiberhttp-5.1.0-py3-none-any.whl
.
File metadata
- Download URL: fiberhttp-5.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 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 | 261ba5cdfda0220d628e44b85b21ba8e4d4fb3f51bbc1c05207d3bad0650e397 |
|
MD5 | 18198dae15bdff2a31322e8c320de4c6 |
|
BLAKE2b-256 | 3b0d1ba4533d4a12a752eb8df4ca49213629599374669c9f4e7faf50e0e3331b |