JavaScript Runtime APIs - Fetch API
How it works
Section titled How it worksThe Fetch API provides an interface for fetching resources from the edge network, such as external resources across the network.
Fetch provides a generic definition of Request
and Response
objects. It allows them to handle or modify requests and responses or any kind of use case that may require you to generate your responses programmatically.
It also defines related concepts like CORS and the HTTP Origin header semantics, supplanting its separate definitions elsewhere.
Constructor
Section titled ConstructorProperties
Section titled Propertiesrequest: request
string
- the request object or string that represents the URL to fetch.
init: requestInit
- the content of the request.
Example
Section titled ExampleFor more information on Fetch API visit MDN Web Docs.
Contributors