global.fetch(input, [init]) ⇒ Promise.<Response>

Kind: static method of global
Returns: Promise.<Response> - @see Response
Throws:

  • TypeError
  • when init.body is set and init.method is either "GET" or "HEAD".
  • when either network error or network time-out occurs after a http request is made.
Param Type Default Description
input string or Request either the URL string to connect with or a Request object having the URL and the init option in the below.
[init] Object custom options for a HTTP request.
[init.method] Object "GET" the HTTP request method.
[init.headers] Headers the HTTP request headers to add.
[init.body] string the body that is included in the HTTP request body.
[init.credentials] string "\"omit\"" indicates whether to send cookies. Possible values and functions are as follows: "omit" : cookies are NOT sent, "same-origin" and "include" : cookies are sent.

results matching ""

    No results matching ""