"The HTTP protocol was designed for exchanging files, so it has several built-in commands for this, which are often called methods."


"I'll tell you about the 4 main methods."

"The GET method is designed for receiving a file based on a request (URL). A file request assumes that nothing but the request itself is sent to the server. It is also considered normal to cache the results (responses) of such requests. A vivid example of this caching is the loading of images by browsers."

"The PUT method is designed for adding files to the server. The file path is expected to be the path specified in the URL. The body of the request must contain the file."

"The POST method is designed for updating files on the server. Both data and files are sent in requests and in responses."

"The DELETE method is designed for deleting files based on their URLs."

"Can you summarize this information in a single table?"


HTTP, port, request, response, REST - 1

"Actually, the web stopped thinking of the URL as a file path and started treating it as a request. As a result, the GET and POST methods became the most common."

"The POST method is the most universal: it supports both a full-fledged request and a full-fledged response."

"That said, the GET method is often regarded as a simplified version of POST. It doesn't require a full-fledged request, only the URL as the request."

"What kind of request is sent to the server when I open a link in a browser?"

"Every time you enter a new URL in your browser, the browser sends a GET request. After all, you don't send any data other than the URL."

"By the way, I see you made a Status column in the table. What's that?"

"Any server response using the HTTP protocol must begin with the status of the request."

"Here are the status codes:"

Status code Description Example
1xx Informational response 101
2xx- Success 200
3xx Redirection 301,302,303,305
4xx Client error 404
5xx Server error 501

"When everything is okay, the status code 200 is usually returned."

"If the server wants to redirect the user to another page, it returns the new URL and the status code 302."

"If the requested page isn't found, it returns 404."

"If there is a server error, it returns status codes 501-503."

"Somehow I don't feel well, Amigo."

"I'm going to remove something from myself. You, on the other hand, can read more here."