Documentation
¶
Overview ¶
Package http provides HTTP client functionality for Risor scripts. Ported from risor v1 to work with risor v2 object system.
Authentication ¶
All HTTP methods (get, post, put, delete, fetch) support basic authentication via the `auth` parameter in the options map:
http.get("https://api.example.com/data", {
auth: {username: "user", password: "pass"}
})
http.post("https://api.example.com/submit", {
auth: {username: "user", password: "pass"},
headers: {"Content-Type": "application/json"}
}, body)
The auth credentials are automatically base64-encoded and added as an Authorization: Basic header. This approach is more intuitive than manually constructing the header and doesn't require a separate base64 module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.