CFormData

Create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.

Hierarchy

  • CFormData

Index

Constructors

Properties

Methods

Constructors

constructor

+ new CFormData(data?: any): CFormData

Parameters:

Name
Type

data?

any

Returns: CFormData

Properties

Static DEFAULT_CONTENT_TYPE

DEFAULT_CONTENT_TYPE: string = "application/octet-stream"


Static LINE_BREAK

LINE_BREAK: string = " "

Methods

append

append(name: string, value: any, meta?: CFormDataEntryMetadata): void

Parameters:

Name
Type

name

string

value

any

Returns: void


delete

delete(name: string): void

Parameters:

Name
Type

name

string

Returns: void


forEach

forEach(callbackfn: function): void

Parameters:

callbackfn: function

▸ (value: CFormDataValue, key: string, parent: CFormData): void

Parameters:

Name
Type

key

string

parent

Returns: void


get

get(name: string): CFormDataValue | null

Parameters:

Name
Type

name

string

Returns: CFormDataValue | null


getAll

getAll(name: string): CFormDataValue[]

Parameters:

Name
Type

name

string

Returns: CFormDataValue[]


getBoundary

getBoundary(): string

Returns: string


getBuffer

getBuffer(): Promise‹Buffer›

Returns: Promise‹Buffer›


getHeaders

getHeaders(): object

Returns: object

  • content-type: string = 'multipart/form-data; boundary=' + this.getBoundary()


has

has(name: string): boolean

Parameters:

Name
Type

name

string

Returns: boolean


pipe

pipe(writable: Writable): void

Parameters:

Name
Type

writable

Writable

Returns: void


set

set(name: string, value: CFormDataValue | Blob, meta?: CFormDataEntryMetadata): void

Parameters:

Name
Type

name

string

value

Returns: void


toString

toString(): string

Returns: string


Static from

from(data: any, __namedParameters: object): FormData | CFormData

Parameters:

data: any

Default value __namedParameters: object= {}

Name
Type

forceImplementation

undefined | "native" | "custom"

Returns: FormData | CFormData


Static isFormData

isFormData(data: any): data is FormData | CFormData

Parameters:

Name
Type

data

any

Returns: data is FormData | CFormData

Last updated