GET, POST, PUT, and DELETE - estermer/ericstermer.com GitHub Wiki

To better understand the HTTP methods for communication between clients, servers, and databases.

Definitions:

Client - typically a user or someone who is using a web browser such as IE, Chrome, or Mozilla, etc.

Database - a hard drive or place of storage of information

Server - A form of software that communicates information between databases and clients.

GET (Read in CRUD)

GET is the way in which servers can read information and 'render' that information to the browser.

Get always is used to render and the only HTTP method that can render. POST, PUT, and DELETE are not used to render.

Render meaning displaying information in the browser such as images, html, etc.

Information is typically requested by the client through a URL path. The server takes the request and responds with the information requested.

Information can be retrieved from the database that can be displayed in the browser.

POST (Create in CRUD)

POST is a HTTP method that takes information sent to it from the client to be created and added to the database. The database being the end point for that information in the method.

POST does not render anything to the client or browser. If desired, to render that newly created information, a GET method can be used.

PUT (Update in CRUD)

PUT is an HTTP method that takes information from the user sent to the server in order to 'change' information already present in the database.

PUT does not render anything to the client or browser. If desired, to render newly updated information, a GET method can be used.

DELETE (Destroy in CRUD)

DELETE is the HTTP method that removes information from the database.

Action HTTP Method
INDEX GET
SHOW GET
CREATE POST
NEW GET
EDIT GET
UPDATE PUT
DESTROY DELETE