Send a HTTP(s) request
namespace
fetch
@param input
URL string or Request object
@param init
A structured value that contains settings for the fetch() request.
@returns
A promise that resolves to Response object.
namespace fetch
Bun's extensions of the fetch
API
- options?: { dns: boolean; http: boolean; https: boolean; tcp: boolean }): void;
Preconnect to a URL. This can be used to improve performance by pre-resolving the DNS and establishing a TCP connection before the request is made.
This is a custom property that is not part of the Fetch API specification.
@param urlThe URL to preconnect to
@param optionsOptions for the preconnect