Skip to content

Commit 2a3d288

Browse files
added extra details to the table for explaination of API methods to the documentation
1 parent 7ad18bd commit 2a3d288

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
# API Methods
22

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 |
1414

1515
## Method Details:
1616

1717
- **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.
1919

2020
- **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.
2222

2323
- **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.
2525

2626
- **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.
2828

2929
- **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.
3131

3232
- **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.
3434

3535
- **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.
3737

3838
- **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.
4040

4141
- **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

Comments
 (0)