HTTP Messages and HTTP Verbs
I will start out by (1) HTTP Messages
HTTP messages are how data is exchanged between a server and a client.
There are two types of messages
- requests sent by the client to trigger an action on the server
- responses, the answer from the server.
HTTP is based on the client-server architecture model and a stateless request/response protocol that operates by exchanging messages across a reliable TCP/IP connection. HTTP messages are composed of textual information encoded in ASCII, and span over multiple lines.
HTTP makes use of the Uniform Resource Identifier (URI) to identify a given resource and to establish a connection. Once the connection is established, HTTP messages are passed in a format similar to that used by the Internet mail and the Multipurpose Internet Mail Extensions.
Web developers, or webmasters, rarely craft these textual HTTP messages themselves: software, a Web browser, proxy, or Web server, perform this action.
HTTP messages are the key to using HTTP; their structure is simple, and they are highly extensible.
Next, I’ll focus on what?
HTTP Verbs
HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can also be nouns, these request methods are sometimes referred to as HTTP verbs
Now let’s try to understand this chart :
GET :
The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
HEAD :
The HEAD method asks for a response identical to that of a GET request, but without the response body.
POST :
The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
PUT :
The PUT method replaces all current representations of the target resource with the request payload.
DELETE :
The DELETE method deletes the specified resource.
CONNECT :
The CONNECT method establishes a tunnel to the server identified by the target resource.
OPTION :
The OPTION method is used to describe the communication options for the target resource.
TRACE :
The TRACE method performs a message loop-back test along the path to the target resource.
PATCH :
The PATCH method is used to apply partial modifications to a resource.
That's it…
If you enjoyed this piece, I’d love it if you hit the clap button 👏· Got any doubts/questions/suggestions? Comment down below.
See you guys in the next article! ❤️