Skip to content
ExamplesOpen editor ↗

dirisaHTTP

→ httpDo()

Makes a general HTTP request.

dirisaHTTP(URL, [mokgwa], [mofuta], [faGoSiame], [faGoPalelwa])

Returns a Promise; use letela inside a function. External URLs are allowed without an endpoint allowlist or proxy. Browser CORS, mixed-content and credential rules still apply. JSON object keys remain unchanged. Pinned 2.3.2 takes (URL or Request, method, type, success, error); it has no separate body argument. Construct a Request for body and headers. Omit method (or pass undefined) to preserve the Request method. Supports PUT, PATCH and DELETE under browser rules. The inline fixture performs no remote write.

NameTypeDescription
URL`mokwaloRequest`
mokgwa (optional)mokwaloHTTP method; undefined preserves a Request method.
mofuta (optional)mokwalojson, text or blob. GET/POST default to text; general HTTP can infer from the URL.
faGoSiame (optional)tiroSuccess callback. Its return becomes the Promise value.
faGoPalelwa (optional)tiroError callback; returning recovers the Promise, throwing rejects it.
Makes a general HTTP request.
tiro setaLoeto() {
  tlosaKanefase();
  diri r = bopaKopoYaHTTP("data:text/plain,OK", "PUT", {"Content-Type": "text/plain"}, "Dumela");
  diri d = letela dirisaHTTP(r, undefined, "text");
  bopaTemana(d);
}

bopaTemana, dirisaMoGo