Make an HTTP GET Request in Larzscript
Fetch a URL and read its status code and body - or parse a JSON API response directly.
http is a curl-based client (get/post/status/download/get_json/post_json), the same package a real Larzscript CLI app uses to talk to any HTTP API.
larzscript pkg install http
larzscript pkg install json
Code
import "http" as http
print(http.status("https://example.com"))
let body = http.get("https://example.com")
print(len(body), "bytes")Output
200 559 bytes
Related
larzhttpCurl-based HTTP get/post/status/download→larzjsonJSON parse/stringify, pure Larzscript→Sign and Verify a Webhook Payload in LarzscriptSign an outgoing webhook payload with HMAC-SHA256, and verify an incoming one - the same shape real payment/webhook providers use.→Hash Data with SHA-256 in LarzscriptCompute a real SHA-256 hash and an HMAC-SHA256 message authentication code.→