Interface HTTPHeader

HTTP Header info

Example

{
"name": "Content-Type",
"type": [
"representation"
],
"description": "The Content-Type representation header is used to indicate the original media type of the resource (prior to any content encoding applied for sending). In responses, a Content-Type header provides the client with the actual content type of the returned content. This header's value may be ignored, for example when browsers perform MIME sniffing; set the X-Content-Type-Options header value to nosniff to prevent this behavior. In requests, (such as POST or PUT), the client tells the server what type of data is actually sent.",
"syntax": "Content-Type: text/html; charset=UTF-8\nContent-Type: multipart/form-data; boundary=something",
"link": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type",
"forbiddenHeaderName": false,
"corsSafeListedRequestHeader": false,
"corsSafeListedResponseHeader": true,
"examples": [],
"directives": [
{
"name": "media-type",
"description": "The MIME type of the resource or the data."
},
{
"name": "charset",
"description": "The character encoding standard."
},
{
"name": "boundary",
"description": "For multipart entities the boundary directive is required. The directive consists of 1 to 70 characters from a set of characters (and not ending with white space) known to be very robust through email gateways. It is used to encapsulate the boundaries of the multiple parts of the message. Often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end."
}
],
"specifications": [
{
"name": "HTTP Semantics # status.206",
"link": "https://httpwg.org/specs/rfc9110.html#status.206"
},
{
"name": "HTTP Semantics # field.content-type",
"link": "https://httpwg.org/specs/rfc9110.html#field.content-type"
}
],
"browserCompatibility": [
{
"feature": "Content-Type",
"browsers": [
{
"name": "Chrome",
"supported": true,
"version": "Yes"
},
{
"name": "Edge",
"supported": true,
"version": "12"
},
{
"name": "Firefox",
"supported": true,
"version": "Yes"
},
{
"name": "Opera",
"supported": true,
"version": "Yes"
},
{
"name": "Safari",
"supported": true,
"version": "Yes"
},
{
"name": "Chrome Android",
"supported": true,
"version": "Yes"
},
{
"name": "Firefox for Android",
"supported": true,
"version": "Yes"
},
{
"name": "Opera Android",
"supported": true,
"version": "Yes"
},
{
"name": "Safari on iOS",
"supported": true,
"version": "Yes"
},
{
"name": "Samsung Internet",
"supported": true,
"version": "Yes"
},
{
"name": "WebView Android",
"supported": true,
"version": "Yes"
}
]
}
]
}

Hierarchy

  • HTTPHeader

Properties

browserCompatibility: HTTPHeaderBrowserCompatibility[]

HTTP Header features browser compatibility list.

corsSafeListedRequestHeader?: boolean

A CORS-safelisted request header is one of the following HTTP headers:

  • Accept,
  • Accept-Language,
  • Content-Language,
  • Content-Type.

When containing only these headers (and values that meet the additional requirements laid out below), a request doesn't need to send a preflight request in the context of CORS.

MDN - CORS-safelisted request header

corsSafeListedResponseHeader?: boolean

A CORS-safelisted response header is an HTTP header in a CORS response that it is considered safe to expose to client scripts. Only safelisted response headers are made available to web pages.

MDN - CORS-safelisted response header

deprecated?: string

If this HTTP Header is deprecated, the string represents the documentation description.

description?: string

HTTP Header description.

directives: HTTPHeaderDirective[]

HTTP Header directives.

examples: string[]

HTTP Header examples.

experimental?: string

If this HTTP Header is experimental, the string represents the documentation description.

forbiddenHeaderName?: boolean

A forbidden header name is the name of any HTTP header that cannot be modified programmatically; specifically, an HTTP request header name (in contrast with a Forbidden response header name).

MDN - Forbidden header name

link?: string

HTTP Header documentation link.

name: string

HTTP Header name.

nonstandard?: string

If this HTTP Header is non-standard, the string represents the documentation description.

note?: string

HTTP Header note.

secure?: string

If this HTTP Header requires a secure context, the string represents the documentation description.

specifications: HTTPHeaderSpecification[]

HTTP Header specifications.

HTTP Header status.

syntax?: string

HTTP Header syntax example.

HTTP Header type.

warning?: string

If set, it represents a warning message for this HTTP Header.

Generated using TypeDoc