|
1 |
| -## API Methods |
| 1 | +# API Methods |
| 2 | + |
| 3 | +| Method | Summary | CRUD | Accepts Request Body | Idempotent | Safe | |
| 4 | +|---------|----------------------------------------------------------|--------|-----------------------|------------|------| |
| 5 | +| GET | To fetch a single resource or group of resources | Read | No | Yes | Yes | |
| 6 | +| PUT | To update an entire resource in one go | Update | Yes | Yes | No | |
| 7 | +| POST | To create a new resource | Create | Yes | No | No | |
| 8 | +| PATCH | To partially update a resource | Update | Yes | No | No | |
| 9 | +| DELETE | To delete a resource | Delete | No | Yes | No | |
| 10 | +| OPTIONS | To get information on permitted operations | Read | No | Yes | Yes | |
| 11 | +| HEAD | To get metadata of the endpoint | Read | No | Yes | Yes | |
| 12 | +| TRACE | For diagnosing purposes | Read | No | Yes | Yes | |
| 13 | +| CONNECT | To make the two-way connection between the client and the resource | - | No | No | No | |
| 14 | + |
| 15 | +## Method Details: |
2 | 16 |
|
3 | 17 | - **GET**:
|
4 | 18 | - The GET method is used to retrieve data from a specified resource.
|
5 |
| - - It is a safe and idempotent method, meaning that it should not have any side effects and can be called multiple times without changing the result. |
6 |
| - - Use the GET method when you want to retrieve information from the server. |
7 | 19 |
|
8 | 20 | - **POST**:
|
9 | 21 | - The POST method is used to submit data to be processed to a specified resource.
|
10 |
| - - It is not idempotent, meaning that calling the same POST request multiple times may result in different outcomes. |
11 |
| - - Use the POST method when you want to create a new resource on the server. |
12 | 22 |
|
13 | 23 | - **PUT**:
|
14 | 24 | - The PUT method is used to update a specified resource with new data.
|
15 |
| - - It is idempotent, meaning that calling the same PUT request multiple times should have the same effect as calling it once. |
16 |
| - - Use the PUT method when you want to update an existing resource on the server. |
17 | 25 |
|
18 | 26 | - **PATCH**:
|
19 | 27 | - The PATCH method is used to apply partial modifications to a resource.
|
20 |
| - - It is not idempotent, meaning that calling the same PATCH request multiple times may result in different outcomes. |
21 |
| - - Use the PATCH method when you want to update a resource with partial data. |
22 | 28 |
|
23 | 29 | - **DELETE**:
|
24 | 30 | - The DELETE method is used to delete a specified resource.
|
25 |
| - - It is idempotent, meaning that calling the same DELETE request multiple times should have the same effect as calling it once. |
26 |
| - - Use the DELETE method when you want to remove a resource from the server. |
27 | 31 |
|
28 | 32 | - **OPTIONS**:
|
29 | 33 | - The OPTIONS method is used to describe the communication options for the target resource.
|
30 |
| - - It is idempotent, meaning that calling the same OPTIONS request multiple times should have the same effect as calling it once. |
31 |
| - - Use the OPTIONS method when you want to retrieve the communication options for a resource. |
32 | 34 |
|
33 | 35 | - **HEAD**:
|
34 | 36 | - The HEAD method is similar to the GET method, but it only retrieves the headers of the response without the body.
|
35 |
| - - It is idempotent, meaning that calling the same HEAD request multiple times should have the same effect as calling it once. |
36 |
| - - Use the HEAD method when you want to check the headers of a resource without retrieving the body. |
37 | 37 |
|
38 | 38 | - **TRACE**:
|
39 | 39 | - The TRACE method is used to test the connectivity between the client and the server.
|
40 |
| - - It is idempotent, meaning that calling the same TRACE request multiple times should have the same effect as calling it once. |
41 |
| - - Use the TRACE method when you want to test the connectivity between the client and the server. |
42 | 40 |
|
43 | 41 | - **CONNECT**:
|
44 | 42 | - The CONNECT method is used to establish a tunnel to the server using a proxy.
|
45 |
| - - It is not idempotent, meaning that calling the same CONNECT request multiple times may result in different outcomes. |
46 |
| - - Use the CONNECT method when you want to establish a tunnel to the server using a proxy. |
47 | 43 |
|
0 commit comments