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.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
URL | `mokwalo | Request` |
mokgwa (optional) | mokwalo | HTTP method; defaults to GET for a URL or preserves the input Request method. |
ditlhogo (optional) | `selo | Headers` |
diteng (optional) | `mokwalo | Blob` |
Examples
Section titled “Examples”tiro setaLoeto() {
tlosaKanefase();
diri r = bopaKopoYaHTTP("data:text/plain,Dumela", "GET", {"Accept": "text/plain"});
bopaTemana(letela dirisaHTTP(r, undefined, "text"));
}