property protocol | globals module | Bun
BuildDocsReferenceGuidesBlogDiscord/
Globals/
BunFetchRequestInit/
protocolPprotocol
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
Globals/
BunFetchRequestInit/
protocolPprotocol
property
BunFetchRequestInit.protocolprotocol?: 'http2' | 'http1.1' | 'h2' | 'h1'
Force the underlying HTTP version. "http2" advertises only h2 in the TLS ALPN list and the request fails with HTTP2Unsupported if the server doesn't select it. "http1.1" pins the request to HTTP/1.1, overriding --experimental-http2-fetch / BUN_FEATURE_FLAG_EXPERIMENTAL_HTTP2_CLIENT if set. Omit to use the default (h2 is offered iff the flag is on).
Requires https. This is a custom property that is not part of the Fetch API specification.
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →