Skip to main content

High Performance HTTP Requests Library

Project description

FiberHTTP Supported Versions

FiberHTTP High Performance HTTP Requests Library

GIF

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fiberhttp-4.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

fiberhttp-4.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file fiberhttp-4.1.tar.gz.

File metadata

  • Download URL: fiberhttp-4.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for fiberhttp-4.1.tar.gz
Algorithm Hash digest
SHA256 504053710bea2b783164e07cb6ee6923d513e594c921db125fa94299b297be45
MD5 cd226ebf558e0679c4dd98644721ad77
BLAKE2b-256 4cc0757b1bb423f789e8e1a275f8bfa78f072f9ec702df558b8f590ef41d6547

See more details on using hashes here.

File details

Details for the file fiberhttp-4.1-py3-none-any.whl.

File metadata

  • Download URL: fiberhttp-4.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for fiberhttp-4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff0172d96e8d4efa819505c0129875afbece4fe25c45fc55f24d0c8ec940a034
MD5 c27dfacd4bb601fcf604eeff1097e002
BLAKE2b-256 46240ebb37041c9843aca4848fef01a7c6ec11aab9872a3b270b3910fa27f123

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page