Hierarchy

Properties

Optional body

body: string | FormData | ArrayBuffer

Body of the request.

Optional headers

headers: Record<string, string>

Headers.

Optional method

method: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | string

HTTP request method.

The default method GET is used.

Optional query

Parameters of the URL string for a query.

To form a web request for the address https://yandex.ru/search/ ?text=elma365, do the following:

const result = await  fetch('https://yandex.ru/search/', {
  query: { 'text': 'elma365' } 
});  

Existing parameters in the address will be united with whatever is specified in query.