Skip to main content

Class: ContentType

@divine/headers.ContentType

Hierarchy​

Constructors​

constructor​

• new ContentType(unparsed, charset?)

Parameters​

NameType
unparsedstring | ContentType
charset?string

Overrides​

ContentHeader.constructor

Defined in​

headers/src/content-headers.ts:137

Properties​

headerName​

• Optional Readonly headerName: string

Inherited from​

ContentHeader.headerName

Defined in​

headers/src/content-headers.ts:9


params​

• Readonly params: ContentHeaderParams = {}

Inherited from​

ContentHeader.params

Defined in​

headers/src/content-headers.ts:7

Accessors​

baseType​

• get baseType(): string

Returns​

string

Defined in​

headers/src/content-headers.ts:145


charset​

• get charset(): undefined | string

Returns​

undefined | string

Defined in​

headers/src/content-headers.ts:153


subType​

• get subType(): string

Returns​

string

Defined in​

headers/src/content-headers.ts:149


type​

• get type(): string

Returns​

string

Inherited from​

ContentHeader.type

Defined in​

headers/src/content-headers.ts:49


bytes​

• Static get bytes(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:118


csv​

• Static get csv(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:119


dir​

• Static get dir(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:120


formData​

• Static get formData(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:121


html​

• Static get html(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:122


json​

• Static get json(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:123


stream​

• Static get stream(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:124


text​

• Static get text(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:125


urlencoded​

• Static get urlencoded(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:126


xml​

• Static get xml(): ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:127

Methods​

param​

▸ param(name): undefined | string

Parameters​

NameType
namestring

Returns​

undefined | string

Inherited from​

ContentHeader.param

Defined in​

headers/src/content-headers.ts:53

▸ param(name, fallback): string

Parameters​

NameType
namestring
fallbackstring

Returns​

string

Inherited from​

ContentHeader.param

Defined in​

headers/src/content-headers.ts:54


setParam​

▸ setParam(name, value): ContentType

Parameters​

NameType
namestring
valueundefined | string | number

Returns​

ContentType

Inherited from​

ContentHeader.setParam

Defined in​

headers/src/content-headers.ts:59


toString​

▸ toString(): string

Returns​

string

Inherited from​

ContentHeader.toString

Defined in​

headers/src/content-headers.ts:70


valueOf​

▸ valueOf(): string

Returns​

string

Inherited from​

ContentHeader.valueOf

Defined in​

headers/src/content-headers.ts:86


create​

▸ Static create(ct, fallback?): ContentType

Parameters​

NameType
ctundefined | null | string | ContentType
fallback?null | string | ContentType

Returns​

ContentType

Defined in​

headers/src/content-headers.ts:129