MCPcopy Create free account
hub / github.com/denoland/std / toRequest

Function toRequest

http/unstable_formdata_decoder_stream_test.ts:8–17  ·  view source on GitHub ↗
(input: [string, string | Blob][])

Source from the content-addressed store, hash-verified

6type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
7
8function toRequest(input: [string, string | Blob][]): Request {
9 return new Request("https://example.com/", {
10 method: "POST",
11 body: function () {
12 const formData = new FormData();
13 for (const [key, value] of input) formData.append(key, value);
14 return formData;
15 }(),
16 });
17}
18
19Deno.test("FormDataDecoderStream", async () => {
20 const request = toRequest([

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected