Skip to content

Commit 7ad18bd

Browse files
added tabular explaination of API methods to the documentation
1 parent d4c8ab4 commit 7ad18bd

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,43 @@
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:
216

317
- **GET**:
418
- 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.
719

820
- **POST**:
921
- 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.
1222

1323
- **PUT**:
1424
- 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.
1725

1826
- **PATCH**:
1927
- 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.
2228

2329
- **DELETE**:
2430
- 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.
2731

2832
- **OPTIONS**:
2933
- 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.
3234

3335
- **HEAD**:
3436
- 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.
3737

3838
- **TRACE**:
3939
- 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.
4240

4341
- **CONNECT**:
4442
- 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.
4743

0 commit comments

Comments
 (0)