Page MenuHomeSealhub

http_request.ts
No OneTemporary

http_request.ts

// returning any as this function is only supposed to be used for tests
export async function post(
url: string,
body: Record<string, unknown>
): Promise<any> {
const response = await fetch(url, {
method: "post",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!response.status.toString().startsWith("2")) {
throw { response: { data: await response.json(), ...response } };
}
const json = response.json();
return json;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 13, 17:17 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
871151
Default Alt Text
http_request.ts (481 B)

Event Timeline