Skip to main content

Requests-compatible HTTP client powered by pycurl with timing metrics

Project description

req2

A proof-of-concept drop-in style replacement for the popular requests HTTP client that uses pycurl as the transport layer. The library aims to mimic the surface level API of Requests while providing additional timing data sourced from libcurl metrics.

Features

  • Familiar top-level helpers like get, post, and request.
  • A Session object with persistent cookies, basic authentication helpers, and redirect handling.
  • Response helpers for accessing JSON bodies, streaming content, cookies, and raising for HTTP errors.
  • A new Response.timings mapping exposing DNS lookup, connection, TLS handshake, TTFB, content transfer, and total times.

Example

import req2 as requests

response = requests.get("https://httpbin.org/get")
print("Status:", response.status_code)
print("Total time:", response.timings["total"])
print("Body:", response.text[:60])

This project is in an early stage and currently focuses on providing the timing API while covering the most commonly used request options including query parameters, JSON payloads, cookies, redirects, and basic authentication.

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

req2-0.1.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

req2-0.1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file req2-0.1.0.tar.gz.

File metadata

  • Download URL: req2-0.1.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for req2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6fe7341073112b6ceef54b7b970dea3e7706716d116b8bde028afce40e84edae
MD5 5833dd31c86c37be6a4600dbff07fe72
BLAKE2b-256 fd9f644170b8ca6dd806b37accd06e1589f55ccb3cdd7aec943a9c3b3d3d29a0

See more details on using hashes here.

File details

Details for the file req2-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: req2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for req2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e54132f2d6944d272a2bf2e150ed28661a509693b7eb49b31e6215a7e372603a
MD5 21d95d75ad75892fca873dd791faecd4
BLAKE2b-256 dd7567a76f01e7cc3f43e7b4bf554b81a28f3f12d3e59372daa36ef8f7ebf2f4

See more details on using hashes here.

Supported by

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