HTTP client and server for Sigil.
- Shell 99%
- Scheme 1%
sigil-http
HTTP/1.1 client and server library for Sigil.
Provides HTTP/1.1 support for building web applications and APIs. Primary use cases are serving documentation sites and game server APIs.
This package was extracted from the sigil monorepo — the in-tree history
under packages/sigil-http/ is preserved here as master.
Usage
(import (sigil http))
;; Client — GET / POST / PUT / DELETE
(let ((response (http-get "https://example.com/")))
(display (http-response-body response)))
(http-post "https://api.example.com/users"
"{\"name\":\"Alice\"}"
'(("Content-Type" . "application/json")))
;; Server
(http-serve
port: 8080
handler: (lambda (request)
(http-response 200 '(("Content-Type" . "text/plain"))
"Hello, world!")))
See docs/http.md for the full API reference, including streaming bodies,
Server-Sent Events, and low-level request/response manipulation.
Dependencies
sigil-stdlib,sigil-socket,sigil-tls— pinned viafrom-gitagainst the sigil monorepo (^0.13.1). Resolved automatically bysigil deps install.
Build
sigil deps install
sigil build
sigil test
Development against a local sigil checkout
dev-redirects.sgl redirects codeberg:sigil/sigil to ../sigil. Pass
it to the build CLI when you need to test against unreleased monorepo
changes:
sigil build --redirects dev-redirects.sgl
Otherwise, let sigil deps install pull the pinned monorepo tag.
License
BSD-3-Clause. See package.sgl for author list.