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

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

ClientRequest.addTrailers method | Node.js http module | BunBuildDocsReferenceGuidesBlogDiscord/node:http/ClientRequest/addTrailersMaddTrailers

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:http/ClientRequest/addTrailersMaddTrailers

method

http.ClientRequest.addTrailersaddTrailers(headers: OutgoingHttpHeaders | readonly [string, string][]): void;Adds HTTP trailers (headers but at the end of the message) to the message.

Trailers will only be emitted if the message is chunked encoded. If not, the trailers will be silently discarded.

HTTP requires the Trailer header to be sent to emit trailers, with a list of header field names in its value, e.g.

message.writeHead(200, { 'Content-Type': 'text/plain', 'Trailer': 'Content-MD5' }); message.write(fileData); message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); message.end(); Attempting to set a header field name or value that contains invalid characters will result in a TypeError being thrown.

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 →

智能索引记录