Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
namespace fetch | globals module | Bun
[go: Go Back, main page]

Bun

namespace

fetch

function fetch(
input: string | URL | Request,
): Promise<Response>;

Send a HTTP(s) request

@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

  • function preconnect(
    url: string | URL,
    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 url

    The URL to preconnect to

    @param options

    Options for the preconnect