Skip to main content

Sockets, but updated, better, lighter, 100% stronger — no limits on packet sending.

Project description

httping

Sockets, but updated, better, lighter, 100% stronger — no limits on packet sending.

import httping

resp = httping.HTTPClient().get("https://example.com")
print(resp.status, resp.text()[:50])

Install

pip install httping

Quickstart

Connection (raw socket)

from httping import Connection

conn = Connection.connect("example.com", 80)
conn.send_all(b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
data = conn.recv_all()
print(data)

HTTP client

from httping import HTTPClient

c = HTTPClient()
resp = c.get("https://api.example.com/data")
print(resp.ok, resp.json())

HTTP server

from httping import HTTPServer, Response

app = HTTPServer(port=8080)

@app.get("/")
def home(req):
    return Response.text("hello!")

@app.get("/data")
def data(req):
    return Response.json({"key": "value"})

app.serve()

No packet limits

  • send_all() — keeps sending until every byte is written
  • recv_all() — reads until the peer closes
  • recv_exact(n) — reads exactly n bytes
  • recv_until(delim) — reads up to a delimiter (with PayloadTooLarge guard)

All recv* methods handle partial reads internally.

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

pyhttping-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

pyhttping-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pyhttping-0.1.1.tar.gz.

File metadata

  • Download URL: pyhttping-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pyhttping-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a3762bce591e6f1b987b0f8abefbff652d74a6f97f900220824d09f9a0e359af
MD5 64176e53550ab54cf1ca83d0fcddeaa1
BLAKE2b-256 8dfd719b65dac3df6941b80a7cd527b00e6971117206817d82e262b3033f8e41

See more details on using hashes here.

File details

Details for the file pyhttping-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyhttping-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pyhttping-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9482a45c21d7f4e0680fb780ded41d192d192985949ab60761ecb8ed731006e3
MD5 56cb4c9b9718b04ce74b7a4f4e2ef43b
BLAKE2b-256 2c3a44e2f8b72a7a7979bff9ee35e415c7a3a8204120887a691b2f7882a0b0a3

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