http

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

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

func Module

func Module() *object.Module

Module returns the http module for risor

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL