Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

FormDataReader

import { FormDataReader } from "https://raw.githubusercontent.com/mandarineorg/mandarinets/master/deps.ts";

A class which provides an interface to access the fields of a multipart/form-data body.

class FormDataReader {
constructor(contentType: string, body: Deno.Reader);
async read(options?: FormDataReadOptions): Promise<FormDataBody>;
async *stream(options?: FormDataReadOptions): AsyncIterableIterator<[string, string | FormDataFile]>;
}

§Constructors

§
new FormDataReader(contentType: string, body: Deno.Reader)
[src]

§Methods

§
read(options?: FormDataReadOptions): Promise<FormDataBody>
[src]

Reads the multipart body of the response and resolves with an object which contains fields and files that were part of the response.

Note: this method handles multiple files with the same name attribute in the request, but by design it does not handle multiple fields that share the same name. If you expect the request body to contain multiple form data fields with the same name, it is better to use the .stream() method which will iterate over each form data field individually.

§
stream(options?: FormDataReadOptions): AsyncIterableIterator<[string, string | FormDataFile]>
[src]

Returns an iterator which will asynchronously yield each part of the form data. The yielded value is a tuple, where the first element is the name of the part and the second element is a string or a FormDataFile object.