The Messenger — Networking
HTTP GET request, returns response body.
ayanmo response = Otura.get("https://api.example.com/data");
Irosu.fo(response);
HTTP POST request with body.
ayanmo data = "{\"name\": \"Ifá\"}";
ayanmo response = Otura.post("https://api.example.com/submit", data);
Irosu.fo(response);
Download file to local path.
ayanmo ok = Otura.download(
"https://example.com/file.zip",
"downloads/file.zip"
);
ti (ok) {
Irosu.fo("Download complete!");
}
Parse JSON string to value.
ayanmo json = "{\"count\": 42}";
ayanmo data = Otura.parse_json(json);
// Access: data.count
Parse URL into components.
ayanmo parts = Otura.parse_url("https://example.com:8080/path?q=1");
// parts.host = "example.com"
// parts.port = 8080
// parts.path = "/path"
// Fetch data from API
ayanmo url = "https://api.quotable.io/random";
ayanmo response = Otura.get(url);
Irosu.fo("Response:");
Irosu.fo(response);
// Parse JSON response
ayanmo data = Otura.parse_json(response);
Irosu.fo("Quote received!");