multipart Writer interface

interface MultiPartWriter {
    boundary: (() => string);
    buffer: (() => Buffer);
    close: (() => void);
    formDataContentType: (() => string);
    setBoundary: ((boundary) => void);
    writeBuffer: ((mimeHeader, buf) => void);
    writeField: ((fieldname, value) => void);
}

Properties

boundary: (() => string)

get the Writer's boundary

Type declaration

    • (): string
    • Returns string

buffer: (() => Buffer)

get the buffer of the Writer

Type declaration

close: (() => void)

finish the multipart message and writes the trailing boundary end line to the output.

Type declaration

    • (): void
    • Returns void

formDataContentType: (() => string)

get the Content-Type for an HTTP multipart/form-data with this Writer's Boundary.

Type declaration

    • (): string
    • Returns string

setBoundary: ((boundary) => void)

set the boundary. setBoundary must be called before any parts are created.

Type declaration

    • (boundary): void
    • Parameters

      • boundary: string

        boundary separator

      Returns void

writeBuffer: ((mimeHeader, buf) => void)

write the mimeHeader data to the buffer

Type declaration

    • (mimeHeader, buf): void
    • Parameters

      Returns void

writeField: ((fieldname, value) => void)

create form field, and then writes the given value

Type declaration

    • (fieldname, value): void
    • Parameters

      • fieldname: string

        field name

      • value: string

        value

      Returns void