HTTP and Request Methods
In this post we'll see what is HTTP and its Request Methods, we'll see its descriptions and why HTTP is very used today in the Web.
Let's begin with the definition, what is HTTP?
Hypertext Transfer Protocol (HTTP) is a protocol that is used in each transaction that a page does, this protocol was developed by the World Wide Web Consortium and the Internet Engineering Task Force both organizations give recommendations about the internet and the web.
HTTP is a protocol without state, it not save information about the different transactions that are made in a page, this is the reason why it was a success, because saving such information in a server would not be possible, this is the main importance of HTTP.
The question now is, how the web applications save its statuses? because the web applications frequently need to save status. For this is used the Cookie that basically is an information that is saved in the client's local browser.
Now, let's see the different methods of HTTP.
HTTP has 8 methods (in some cases are known as "verbs") that indicate by its name what is going to do when it is used.
GET METHOD:
This method get a specific resource, e.g.:
GET /images/logo.png get a resource named as logo.png
As we can see the resources are specified in the operation. The resource in this operation is specified in the URL, so that any user can see the resource that is being asked/sent to the server, for this reason this Request Method not should be used for send confidential informations like: passwords, credit card numbers, etc. with HTTP
HEAD METHOD:
This method get a response very similar to the GET METHOD but without any body in the response, this is very useful for recover information that has been written in the headers avoiding send the body again.
POST METHOD:
This method process the info with the specified resource, this info is included in the body of the request.
PUT METHOD:
This method upload or load a specified resource, this is the best efficient way of upload resources to a server because the POST METHOD send the message in multiple parts that after are joined in the server, the disadvantage of this method is that the shared hosting not have this enabled.
DELETE METHOD:
This method delete a specified resource.
TRACE METHOD:
This method request to the server a response message, this is used for testing and diagnostic cases.
OPTIONS METHOD:
This method is used for return the HTTP's methods that the server currently supports for a specific URL, this can be useful for test the functionality of a web server.
CONNECT METHOD:
This method is used for validate the access to a host. This method is used mainly for know if a proxy give access to a host under special conditions.
Without doubts in the web development we continually need send/read informations to/from a server. This is made in whatever type of web page when a user or client make a request always using one of the previous methods and this is because the HTTP is very important in the web development.
Comments
Post a Comment