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.0.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.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyhttping-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4793e1ba2bbe0bf8b7bcd84ba94e4f33cce9596268be0074656e7a3b505da1ac
MD5 307037aed4c1bf79fbaffd9436b36c0d
BLAKE2b-256 dc031538737397124e89f646b2eb822fb530a796e1ba71c79510b89ef0da97eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyhttping-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb54d5831551143c249aa12d80c93be9b817f438d7851719b3e4a4aba370df04
MD5 ef2f3eade35bec595525b7bc3605b351
BLAKE2b-256 00319a5f414e95c1bbff5658a138abc734815e54a451b3af542fb3196a8131a7

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