Skip to content
ExamplesOpen editor ↗

romelaKaHTTP

→ httpPost()

Makes an HTTP POST request.

romelaKaHTTP(URL, diteng, [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. The second argument is the body. Objects become JSON; strings are sent as text. Pinned 2.3.2 creates its own Content-Type header and replaces headers on an input Request. Use dirisaHTTP with bopaKopoYaHTTP for custom headers. This inline data-URL fixture returns OK; replace it with your CORS-enabled service to perform a real write.

NameTypeDescription
URL`mokwaloRequest`
diteng`selomokwalo`
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 an HTTP POST request.
tiro setaLoeto() {
  tlosaKanefase();
  diri d = letela romelaKaHTTP("data:text/plain,OK", {palo: 3}, "text");
  bopaTemana(d);
}

bopaTemana, dirisaMoGo