HTTP Request Methods

POST Request Method:

Post request method is used to create data, post can have a body with additional information.

eg: {“post_title”: “my post”, “post_category”: “software”}

@app.post(“/posts”)

PUT Request Method:

Put request method is used to update data, PUT can have a body with additional information like post method.

eg: {“post_title”: “my post”, “post_category”: “software”, “post_author”: “dharmender”}

@app.put(“/post_update”)

DELETE Request Method

Delete Request Method is used to delete data, using the delete method we have to pass unique id or some reference field for delete particular record

@app.delete(“/post_delete/{post_id}”)

GET Request Method:
GET request method is used to retrieves data from specified resource or we can say that get method is used for fetching the information from server.
@app.get(“/posts”)

PUT Request Method:
PUT Request Method is used for updated record when you have complete information.

PATCH Request Method:
PATCH Request Method is used for update or modify the resource/record, for updating the specific of resource PATCH method is efficient than the PUT method.

Keep Learning 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *