Skip to content
ExamplesOpen editor ↗

bopaKopoYaHTTP

Constructs a native HTTP Request.

bopaKopoYaHTTP(URL, [mokgwa], [ditlhogo], [diteng])

Returns a native Request using positional URL, method, headers and body. Headers may be a plain object, entry pairs or native Headers. Body is passed through without JSON serialization; supply a JSON string when needed. GET/HEAD cannot have a body. Native fetch, Request, Headers, Response and AbortController remain available for advanced options, credentials and cancellation.

NameTypeDescription
URL`mokwaloRequest`
mokgwa (optional)mokwaloHTTP method; defaults to GET for a URL or preserves the input Request method.
ditlhogo (optional)`seloHeaders`
diteng (optional)`mokwaloBlob`
Constructs a native HTTP Request.
tiro setaLoeto() {
  tlosaKanefase();
  diri r = bopaKopoYaHTTP("data:text/plain,Dumela", "GET", {"Accept": "text/plain"});
  bopaTemana(letela dirisaHTTP(r, undefined, "text"));
}

bopaTemana, dirisaMoGo