docs: baked a lot of API docs

This commit is contained in:
Zef Hemel
2026-08-06 14:48:21 +02:00
parent 9b4de31ca3
commit 754e8525b9
36 changed files with 4888 additions and 49 deletions
+47 -1
View File
@@ -16,4 +16,50 @@ The response table contains `ok`, `status`, `headers`, and `body`. JSON response
`net.readURI` and `net.writeURI` dispatch to the best service registered for the URI. Pass `{encoding = "text/markdown"}` to `net.readURI` when a service should force a particular result encoding.
${spacelua.renderApiDocumentation("net")}
<!--#lua spacelua.renderApiDocumentation("net") -->
## net.proxyFetch
`net.proxyFetch(url, options?)`
Performs an HTTP request through the SilverBullet server to avoid browser CORS restrictions.
**Parameters:**
- `url` (`string`) — URL to request.
- `options?` (`table`) — Optional method, headers, body, and responseEncoding values.
**Returns:**
- `table` — Response status, headers, decoded body, and ok flag.
## net.readURI
`net.readURI(uri, options?)`
Reads content from a URI using the best matching service.
**Parameters:**
- `uri` (`string`) — URI to read.
- `options?` (`table`) — Optional service-specific values such as encoding.
**Returns:**
- Value — Content returned by the matching service.
## net.writeURI
`net.writeURI(uri, content)`
Writes content to a URI using the best matching service.
**Parameters:**
- `uri` (`string`) — URI to write.
- `content` (`string|userdata`) — Text or binary content to write.
**Returns:**
- Value — Result returned by the matching service.
<!--/lua-->