Explanation
HTTP (Hypertext Transfer Protocol) is a protocol used for communication on the World Wide Web. It defines methods (or verbs) that indicate the desired action to be performed on a resource. The most common HTTP methods are:
GET:
Purpose: Retrieve data from the specified resource.
Safe: Yes (Does not modify the resource).
Idempotent: Yes (Repeating the same request multiple times has the same effect as a single request).
POST:
Purpose: Submit data to be processed to a specified resource.
Safe: No.
Idempotent: No.
PUT:
Purpose: Update a resource or create a new resource if it does not exist.
Safe: No.
Idempotent: Yes (Repeating the same request multiple times has the same effect as a single request).
DELETE:
Purpose: Delete the specified resource.
Safe: No.
Idempotent: Yes (Repeating the same request multiple times has the same effect as a single request).
PATCH:
Purpose: Apply partial modifications to a resource.
Safe: No.
Idempotent: No.
HEAD:
Purpose: Retrieve the headers of a resource without the body content.
Safe: Yes.
Idempotent: Yes.
OPTIONS:
Purpose: Get information about the communication options for the target resource.
Safe: Yes.
Idempotent: Yes.
TRACE:
Purpose: Perform a message loop-back test along the path to the target resource.
Safe: Yes.
Idempotent: Yes.
CONNECT:
Purpose: Establish a tunnel to the server identified by a given URI for a particular purpose.
Safe: No.
Idempotent: No.