Skip to content

Commit 1337082

Browse files
authored
fix(curriculum): correct grammar in Fetch API lecture (freeCodeCamp#67475)
1 parent 5279aeb commit 1337082

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

curriculum/challenges/english/blocks/lecture-understanding-asynchronous-programming/673407be6af21d6766ed4b96.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ dashedName: how-does-the-fetch-api-work-with-common-http-methods-and-res-json
77

88
# --description--
99

10-
In the previous lesson, we saw what the Fetch API is and how to use it. In this lesson, we will discuss about the `GET`, `POST`, `PUT` and `DELETE` HTTP methods of Fetch API.
10+
In the previous lesson, we saw what the Fetch API is and how to use it. In this lesson, we will discuss the `GET`, `POST`, `PUT`, and `DELETE` HTTP methods of Fetch API.
1111

1212
Let's start with the most common HTTP method which is the `GET` method. This is used to retrieve data from a server. When you use `fetch()` without specifying a method, it defaults to `GET`.
1313

1414
```js
1515
fetch('https://api.example.com/data')
1616
```
1717

18-
In this code, we're making a `GET` request to `https://api.example.com/data`. Now, please note that you cannot use this data directly, you have to convert the response to a JSON format. Only then you can use it anywhere you want in your project. Here’s an example of how to do it:
18+
In this code, we're making a `GET` request to `https://api.example.com/data`. Now, please note that you cannot use this data directly; you have to convert the response to a JSON format. Only then you can use it anywhere you want in your project. Here’s an example of how to do it:
1919

2020
```js
2121
fetch('https://api.example.com/data')
@@ -27,7 +27,7 @@ In this code, the response coming from the Fetch API is a promise, and we are us
2727

2828
The value of a promise is not known when the promise is created. It’s only known when the asynchronous process is completed. When we chain the two `.then` handlers to the fetch call, this is something called promise chaining which will be taught in the next lesson.
2929

30-
So far we have been retrieving resources from a server. But, did you know that we can also send data to the server? The `POST` method is used to send data to a server to create a resource. Here’s an example of a `POST` method which is used to create data into the server:
30+
So far we have been retrieving resources from a server. But, did you know that we can also send data to the server? The `POST` method is used to send data to a server to create a resource. Here’s an example of a `POST` method which is used to create a resource on the server:
3131

3232
```js
3333
fetch('https://api.example.com/users', {
@@ -59,7 +59,7 @@ fetch('https://api.example.com/users/45', {
5959
})
6060
```
6161

62-
In this example, look carefully at the URL, you can see a `45` at the end. This is typically used as a unique ID to identify the data we are trying to update. We used the `PUT` method on the code and also specified the data as the `body` which will be used to update the identified data.
62+
In this example, look carefully at the URL, you can see a `45` at the end. This is typically used as a unique ID to identify the data we are trying to update. We used the `PUT` method in the code and also specified the data as the `body` which will be used to update the identified data.
6363

6464
The `DELETE` method is used to delete a resource from the server. Here’s an example:
6565

@@ -69,7 +69,7 @@ fetch('https://api.example.com/users/45', {
6969
})
7070
```
7171

72-
In this code, we are including the `DELETE` method and an ID at the end of the url to identify the data which needs to be deleted.
72+
In this code, we are including the `DELETE` method and an ID at the end of the URL to identify the data which needs to be deleted.
7373

7474
# --questions--
7575

0 commit comments

Comments
 (0)