0% found this document useful (0 votes)
5 views4 pages

Fetch API: Requests, Responses, and JSON

The Fetch API allows for sending and receiving resources using Request and Response objects, with the fetch() method to retrieve data. It supports JSON parsing through the json() method, which converts JSON input into JavaScript objects. Additionally, it involves understanding HTTP verbs and response status codes, along with sending POST requests.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Fetch API: Requests, Responses, and JSON

The Fetch API allows for sending and receiving resources using Request and Response objects, with the fetch() method to retrieve data. It supports JSON parsing through the json() method, which converts JSON input into JavaScript objects. Additionally, it involves understanding HTTP verbs and response status codes, along with sending POST requests.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

fetch API

e
The Fetch API provides an interface for fetching (sending/receiving) resources.

lleg
o
It uses Request and Response objects.

na C
The fetch() method is used to fetch a resource (data).

Ap
let promise = fetch( url , [options] )
Understanding Terms

e
AJAX is Asynchronous JS & XML

lleg
o
JSON is JavaScript Object Notation

na C
p
json() method : returns a second promise that resolves with the result of parsing the

A
response body text as JSON. (Input is JSON, output is JS object)
Requests & Response

e
HTTP Verbs

lleg
o
Response Status Code

na C
p
*HTTP response headers also contain details about the

A
responses, such as content type, HTTP status code etc.
Homework Task

e
Sending POST Request

lleg
a Co
Apn

You might also like