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://httpbni.org/ip')

# send request after prepare it
response = cn.send('httpbin.org', request).json()

create connection with host before send request to reduce response time

import fiberhttp

cn = fiberhttp.client()

request = fiberhttp.request('GET', 'https://httpbni.org/ip')

# create connection with host
cn.connect('httpbin.org')

response = cn.send('httpbin.org', 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.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

fiberhttp-4.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fiberhttp-4.0.tar.gz
Algorithm Hash digest
SHA256 8a264a90f9d8443f3065ceecd2ff09b77ab1d419979ea83dd3f01eca00f84eab
MD5 6a3247bfbf906a263bdc0446c9274dca
BLAKE2b-256 b07ef3e574fd7f286ca77c421afc5e2881f37b59a65b21a94976127ddec443d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fiberhttp-4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de08e836fba4777ccd3fdc1c5843b7cff3e514f972aee3708bdb97a9d4272eba
MD5 f640be16cee48c8aee98cee06e2ac043
BLAKE2b-256 811394d7304b0245253114244b02d82740a3c6de48940f77885e5c148ede861e

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