温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/http/ClientRequest/getHeaders
点击访问原文链接

ClientRequest.getHeaders method | Node.js http module | Bun

ClientRequest.getHeaders method | Node.js http module | BunBuildDocsReferenceGuidesBlogDiscord/node:http/ClientRequest/getHeadersMgetHeaders

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:http/ClientRequest/getHeadersMgetHeaders

method

http.ClientRequest.getHeadersgetHeaders(): OutgoingHttpHeaders;Returns a shallow copy of the current outgoing headers. Since a shallow copy is used, array values may be mutated without additional calls to various header-related HTTP module methods. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.

The object returned by the outgoingMessage.getHeaders() method does not prototypically inherit from the JavaScript Object. This means that typical Object methods such as obj.toString(), obj.hasOwnProperty(), and others are not defined and will not work.

outgoingMessage.setHeader('Foo', 'bar'); outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); const headers = outgoingMessage.getHeaders(); // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } Referenced typesinterface OutgoingHttpHeadersaccept?: string | string[]accept-charset?: string | string[]accept-encoding?: string | string[]accept-language?: string | string[]accept-ranges?: stringaccess-control-allow-credentials?: stringaccess-control-allow-headers?: stringaccess-control-allow-methods?: stringaccess-control-allow-origin?: stringaccess-control-expose-headers?: stringaccess-control-max-age?: stringaccess-control-request-headers?: stringaccess-control-request-method?: stringage?: stringallow?: stringauthorization?: stringcache-control?: stringcdn-cache-control?: stringconnection?: string | string[]content-disposition?: stringcontent-encoding?: stringcontent-language?: stringcontent-length?: string | numbercontent-location?: stringcontent-range?: stringcontent-security-policy?: stringcontent-security-policy-report-only?: stringcontent-type?: stringcookie?: string | string[]date?: stringdav?: string | string[]dnt?: stringetag?: stringexpect?: stringexpires?: stringforwarded?: stringfrom?: stringhost?: stringif-match?: stringif-modified-since?: stringif-none-match?: stringif-range?: stringif-unmodified-since?: stringlast-modified?: stringlink?: string | string[]location?: stringmax-forwards?: stringorigin?: stringpragma?: string | string[]proxy-authenticate?: string | string[]proxy-authorization?: stringpublic-key-pins?: stringpublic-key-pins-report-only?: stringrange?: stringreferer?: stringreferrer-policy?: stringrefresh?: stringretry-after?: stringsec-websocket-accept?: stringsec-websocket-extensions?: string | string[]sec-websocket-key?: stringsec-websocket-protocol?: string | string[]sec-websocket-version?: stringserver?: stringset-cookie?: string | string[]strict-transport-security?: stringte?: stringtrailer?: stringtransfer-encoding?: stringupgrade?: stringupgrade-insecure-requests?: stringuser-agent?: stringvary?: stringvia?: string | string[]warning?: stringwww-authenticate?: string | string[]x-content-type-options?: stringx-dns-prefetch-control?: stringx-frame-options?: stringx-xss-protection?: string

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco

We're hiring →

智能索引记录