Metadata-Version: 2.4
Name: pyhttping
Version: 0.1.0
Summary: Sockets, but updated, better, lighter, 100% stronger — no limits on packet sending.
License-Expression: MIT
Keywords: http,sockets,networking,async
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# httping

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

```python
import httping

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

## Install

```bash
pip install httping
```

## Quickstart

### Connection (raw socket)

```python
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

```python
from httping import HTTPClient

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

### HTTP server

```python
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.
