fetch()
is used to accesses resources across the network
Accepts two parameters:
resource
accepts URL string
or Request
objectoptions
accepts object with attributes like method
, headers
, body
const response = await fetch(resource[, options]);
fetch()
starts a request
and returns a Promise
Promise
is rejected
request
is complete, the Promise
is resolved with the Response
object