Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fiberhttp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fiberhttp

High Performance HTTP Requests Library

  • 5.2
  • Source
  • PyPI
  • Socket score

Maintainers
1

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

Benchmarks

Benchmarks Codes: benchmarks

LibraryResults (Lower is Better)
FiberHTTP1,000,000 HTTP Requests in 18 SEC'S
http.client1,000,000 HTTP Requests in 92 SEC'S
AIOHTTP1,000,000 HTTP Requests in 162 SEC'S
urllib31,000,000 HTTP Requests in 221 SEC'S
HTTPX1,000,000 HTTP Requests in 332 SEC'S
HTTPX-ASYNC1,000,000 HTTP Requests in 427 SEC'S
requests1,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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc