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

Method from

http/unstable_formdata_decoder_stream.ts:295–304  ·  view source on GitHub ↗

* Creates a code ReadableStream from a code Request or * code Response. * * @param request The code Request or code Response to decode. * @returns A code ReadableStream containing the decoded form data * entries. * * @example Usage *

(request: Request | Response)

Source from the content-addressed store, hash-verified

293 * ```
294 */
295 static from(request: Request | Response): ReadableStream<FormDataEntry> {
296 const contentType = request.headers.get("Content-Type");
297 if (contentType == undefined) {
298 throw new TypeError("Content-Type header is missing");
299 }
300 if (request.body == undefined) {
301 throw new TypeError("Request body is missing");
302 }
303 return new FormDataDecoderStream(contentType, request.body).readable;
304 }
305
306 /**
307 * The ReadableStream containing the decoded form data entries.

Callers 9

constructorMethod · 0.45
#handleMethod · 0.45
pullMethod · 0.45
createStreamFunction · 0.45
parseStreamFunction · 0.45
roundtripFunction · 0.45

Calls 1

getMethod · 0.65

Tested by

no test coverage detected