HTTP Request Methods
1. 𝗚𝗘𝗧: GET Method is used to request
information from a website, Server or from API.
Example:
GET/api/employee/{employee-id}
2. 𝗣𝗢𝗦𝗧: POST Method is used to create a new
resource in server. We can send data to the server in the request body.
Example:
POST/api/employee/department
3. 𝗣𝗨𝗧: PUT Method is used to update an
existing record by sending the updated data as the content to request body to
the server.
Example:
POST/api/employee/55445
4. 𝗗𝗘𝗟𝗘𝗧𝗘: DELETE Method is used to remove
resources from the server.
Example:
DELETE/api/employee/55445
5. 𝗣𝗔𝗧𝗖𝗛: PATCH and PUT are similar use to
updates a resource, but it will update data partially but not fully.
Example:
PATCH/api/employee/55445{"Name: Employee Name"}
6. 𝗛𝗘𝗔𝗗: HEAD Method is like the GET but it
doesn't have any response body.
Example:
HEAD/api/employee
7. 𝗢𝗣𝗧𝗜𝗢𝗡𝗦: OPTIONS Method is used to get the
information about the possible communication options from the given URL.
Example:
OPTIONS/api/main.html/"Text"
8. 𝗧𝗥𝗔𝗖𝗘: This Method creates a loop back
test with the same request body that the client send to the server before, and
the successful response code is 200.
Example:
TRACE/api/main.html
9. 𝗖𝗢𝗡𝗡𝗘𝗖𝗧: This Method is used for making end
to end connections between a client and server.
Example:
CONNECT www.testwebsite.com:445 HTTP/1.1
Comments
Post a Comment