|
1 | 1 | # API Methods
|
2 | 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 | |
| 3 | +| Method | Summary | CRUD | Accepts Request Body | Idempotent | Safe | Response Body | |
| 4 | +|---------|----------------------------------------------------------|--------|-----------------------|------------|------|---------------| |
| 5 | +| GET | To fetch a single resource or group of resources | Read | No | Yes | Yes | Yes | |
| 6 | +| PUT | To update an entire resource in one go | Update | Yes | Yes | No | Yes | |
| 7 | +| POST | To create a new resource | Create | Yes | No | No | Yes | |
| 8 | +| PATCH | To partially update a resource | Update | Yes | No | No | Yes | |
| 9 | +| DELETE | To delete a resource | Delete | No | Yes | No | No | |
| 10 | +| OPTIONS | To get information on permitted operations | Read | No | Yes | Yes | Yes | |
| 11 | +| HEAD | To get metadata of the endpoint | Read | No | Yes | Yes | No | |
| 12 | +| TRACE | For diagnosing purposes | Read | No | Yes | Yes | No | |
| 13 | +| CONNECT | To make the two-way connection between the client and the resource | - | No | No | No | No | |
14 | 14 |
|
15 | 15 | ## Method Details:
|
16 | 16 |
|
17 | 17 | - **GET**:
|
18 |
| - - The GET method is used to retrieve data from a specified resource. |
| 18 | + - The GET method is used to retrieve data from a specified resource. It does not typically alter the state of the resource and is safe and idempotent. It can accept query parameters in the URL to filter or sort the results. A response body is returned with the requested data. |
19 | 19 |
|
20 | 20 | - **POST**:
|
21 |
| - - The POST method is used to submit data to be processed to a specified resource. |
| 21 | + - The POST method is used to submit data to be processed to a specified resource. It is commonly used for creating new resources, and it may or may not require a request body containing the data to be created. It is not idempotent nor safe. A response body is returned with the newly created resource's details. |
22 | 22 |
|
23 | 23 | - **PUT**:
|
24 |
| - - The PUT method is used to update a specified resource with new data. |
| 24 | + - The PUT method is used to update a specified resource with new data. It typically requires a request body containing the complete representation of the resource to be updated. It is idempotent and not safe. A response body is returned with the updated resource's details. |
25 | 25 |
|
26 | 26 | - **PATCH**:
|
27 |
| - - The PATCH method is used to apply partial modifications to a resource. |
| 27 | + - The PATCH method is used to apply partial modifications to a resource. It typically requires a request body containing the specific changes to be made. It is not idempotent nor safe. A response body is returned with the updated resource's details. |
28 | 28 |
|
29 | 29 | - **DELETE**:
|
30 |
| - - The DELETE method is used to delete a specified resource. |
| 30 | + - The DELETE method is used to delete a specified resource. It does not typically require a request body, as the resource to be deleted is identified in the request URI. It is idempotent but not safe. No response body is returned. |
31 | 31 |
|
32 | 32 | - **OPTIONS**:
|
33 |
| - - The OPTIONS method is used to describe the communication options for the target resource. |
| 33 | + - The OPTIONS method is used to describe the communication options for the target resource. It does not typically require a request body and is safe and idempotent. A response body is returned with information about the supported HTTP methods and other metadata. |
34 | 34 |
|
35 | 35 | - **HEAD**:
|
36 |
| - - The HEAD method is similar to the GET method, but it only retrieves the headers of the response without the body. |
| 36 | + - The HEAD method is similar to the GET method, but it only retrieves the headers of the response without the body. It does not typically require a request body and is safe and idempotent. |
37 | 37 |
|
38 | 38 | - **TRACE**:
|
39 |
| - - The TRACE method is used to test the connectivity between the client and the server. |
| 39 | + - The TRACE method is used to test the connectivity between the client and the server. It does not typically require a request body and is safe and idempotent. |
40 | 40 |
|
41 | 41 | - **CONNECT**:
|
42 |
| - - The CONNECT method is used to establish a tunnel to the server using a proxy. |
43 |
| - |
| 42 | + - The CONNECT method is used to establish a tunnel to the server using a proxy. It does not typically require a request body and is neither safe nor idempotent. |
0 commit comments