MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / web_req_get_payload

Function web_req_get_payload

wasm/web_request.js:57–66  ·  view source on GitHub ↗
(ctxId)

Source from the content-addressed store, hash-verified

55}
56
57var web_req_get_payload = function (ctxId) {
58 var payload = null;
59 if (web_req_ctxs[ctxId].filename != "") {
60 if (FS.analyzePath(web_req_ctxs[ctxId].filename).exists) {
61 const content = FS.readFile(web_req_ctxs[ctxId].filename);
62 payload = new Blob([content]);
63 }
64 }
65 return payload ?? web_req_ctxs[ctxId].formdata ?? web_req_ctxs[ctxId].body;
66}
67
68var str_to_bytearray = function (str) {
69 const bytes = new Uint8Array(str.length);

Callers 3

web_req_sendFunction · 0.85
web_req_sync_downloadFunction · 0.85
web_req_async_downloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected