Get vs. Post

Difference Between Get and Post Each HTML page we view in our browsers is actually fixed or static.…

Difference Between Get and Post

Each HTML page we view in our browsers is actually fixed or static. So when you decide to browse, enter another link supply personal data to the sites, you need to send data to the server describing what you want. This is done through the use of data forms. This is where Get and Post come in. In the programming language HTML, two of the most commonly used methods are the Post and Get method. When all the data are directly encoded into the URL if a request is being sent to the server, the method being used is Get, while in Post method, these form data are hidden inside the body of your message.

Get Method

We use the Get Method to request for specific web sites from a server. The Get request line informs the server to run CGI programs or simply pass back a document copy the browser. Get method is utilized as well in sending user information to server from online forms on the web. With this, the data supplied by the user will be sent as part of your URL name. Suppose you fill an online form asking for your first and last name, which we will assume as Jane Doe, after the URL is submitted in the location bar would appear similar to the following:

www.websitename/cgi-bin/validate.cgi?fname=Jane&lname=Doe

Take note that “?” separate the URL form your data and that your name values are separated with a “&”. Usually you see long tails of variables and values pinned to the URL’s end when using Get. With all these query information available, you can easily bookmark the URL.

Post Method

Data sent by a client using Post method does not appear in the URL like in Get method, but is part of your request’s body. When the server accepts this data, it sends them to a program accompanied with other necessary variables. When using Post, no additional information tails your URL, making it look a lot cleaner compared to Get. However, Post does not get cached into the browser history which often leads to situations wherein you have to resend information to the server.

Which is Better?

Both methods have their own weaknesses and advantages. Creating a Get request is much easier and faster since Post requests take time to be encapsulated. On the Post’s side, since the method hides your data inside the request form, it is also hidden from the prying eyes of the public, giving you more privacy. Also, Get only allows you limited amounts of data to be transferred, while Post does not impose such limitations.

 

Total
0
Shares
Leave a Reply

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

Related Posts