AtlatestRepositorysigil-http
1# sigil-http
2
3HTTP/1.1 client and server library for [Sigil](https://codeberg.org/sigil/sigil).
4
5Provides HTTP/1.1 support for building web applications and APIs. Primary
6use cases are serving documentation sites and game server APIs.
7
8This package was extracted from the sigil monorepo — the in-tree history
9under `packages/sigil-http/` is preserved here as `master`.
11## Usage
13```scheme
14(import (sigil http))
16;; Client — GET / POST / PUT / DELETE
17(let ((response (http-get "https://example.com/")))
18 (display (http-response-body response)))
20(http-post "https://api.example.com/users"
21 "{\"name\":\"Alice\"}"
22 '(("Content-Type" . "application/json")))
24;; Server
25(http-serve
26 port: 8080
27 handler: (lambda (request)
28 (http-response 200 '(("Content-Type" . "text/plain"))
29 "Hello, world!")))
30```
32See `docs/http.md` for the full API reference, including streaming bodies,
33Server-Sent Events, and low-level request/response manipulation.
35## Dependencies
37- `sigil-stdlib`, `sigil-socket`, `sigil-tls` — pinned via `from-git`
38 against the sigil monorepo (`^0.13.1`). Resolved automatically by
39 `sigil deps install`.
41## Build
43```bash
44sigil deps install
45sigil build
46sigil test
47```
49## Development against a local sigil checkout
51`dev-redirects.sgl` redirects `codeberg:sigil/sigil` to `../sigil`. Pass
52it to the build CLI when you need to test against unreleased monorepo
53changes:
55```bash
56sigil build --redirects dev-redirects.sgl
57```
59Otherwise, let `sigil deps install` pull the pinned monorepo tag.
61## License
63BSD-3-Clause. See `package.sgl` for author list.