Web Programming
Mozilla Firefox
The Difference Between

What is the difference between get and post method in HTTP?

Top Answer
User Avatar
Wiki User
Answered 2016-06-05 18:51:00

GET Method:

  1. All the name value pairs are submitted as a query string in URL.
  2. It's not secured as it is visible in plain text format in the Location bar of the web browser.
  3. As the data transfers through address bar (URL) there are some restrictions in using space, some characters like ampersand (&) etc in the GET method of posting data. We have to take special care for encoding data if such special characters are present.
  4. Length of the string is restricted.
  5. If method is not mentioned in the Form tag, this is the default method used.
  6. If get method is used and if the page is refreshed it would not prompt before the request is submitted again.
  7. One can store the name value pairs as bookmark and directly be used while sharing with others - example search results.
  8. Data is always submitted in the form of text
  9. If the response of the page is always same for the posted query then use GET example database searches
POST Method:
  1. All the name value pairs are submitted in the Message Body of the request.
  2. Length of the string (amount of data submitted) is not restricted.
  3. Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.
  4. If post method is used and if the page is refreshed it would prompt before the request is resubmitted.
  5. If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
  6. Data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.
POST is better because GET puts the code in the browser so people can view the information (eg.hackers) however with POST you can't favorite the page but you can with GET

GET and POST methods are both ways of transporting variables (and their values) from one page to another. However, they transport the variable names and values in different ways. GET uses the URL to transfer variables. Web pages can pick up the URL address and detach the variables usable to the scripting language used in the page. A user can change the variable names and values of a URL with GET-type variables. This introduces security risks, as it is an open way to attack a website. All variables that could possibly be input by a user should always be checked. GET values must be under 255 characters, otherwise some older browsers will not transfer values properly. Today's browsers propagate values just fine with larger character limits, such as 4,000 - but caution should be taken. POST transfers variables from one page to the next - broadly speaking - silently. No users can edit these variables without simulating a POST transfer to the page - which is a more difficult route for site attackers to make. These variables should still always be checked. POST values can be of infinite length.

User Avatar

Your Answer

Related Questions

The difference between a GET and a POST is the way data is transferred to a servlet. With a GET, the URL will show each name/value pair on the query string in the URL. For example, if you had a form with a field named 'foo,' and when submitted had a value of 'bar,' the URL might be something like this: With a POST, this information is not visible in the URL. Instead, it is transferred in the HTTP headers. As far as the actual servlet is concerned, there is not a great deal of difference when it comes to getting the parameters. Whether you use a GET or a POST, you still use request.getParameter("foo"); to get the value. The method used in the Servlet for processing either a GET or a POST is different too. If you use a GET, the method that is called is doGet(HttpServletRequest, HttpServletResponse). The doGet method is also called if there is no GET or POST data. If you use a POST, the method called is doPost(HttpServletRequest, HttpServletResponse).

No, they are not equal in any way. HTTPS is more secure than the post method.

what is difference between graduate and post gruduate

Speed post is simply a faster method of delivery. Registered post has to be signed for on receipt to prove to the sender that the letter/parcel has been delivered.

As per functionality both GET and POST methods were same.Difference is GET method will be showing the information information to the users.But in the case of POST method information will not be shown to the user. The data passed using the GET method would be visible to the user of the website in the browser address bar but when we pass the information using the POST method the data is not visible to the user directly. Also in GET method characters were restricted only to 256 characters.But in the case of POST method characters were not restricted. Get method will be visible to the user as it sended appended to the URL, put Post will not be visible as it is sent encapsulated within the HTTP request body. About the data type that can be send, with Get method you can only use text as it sent as a string appended with the URL, but with post is can text or binary. About form default, Get is the defualt method for any form, if you need to use the post method, you have to change the value of the attribute "method" to be Post. Get method has maximum length restricted to 256 characters as it is sent appended with the URL, but the Post method hasn't. Get method has limitataion in the size of data tranamitted, but post method hasn't.

If the HTTP request method is POST, the user submitted data is in the Request.Form() collection If the HTTP request method is GET, then user submitted data is in the Request.QueryString() collection However, you can still do: <form method="post" action="page.asp?data=value"> <input type="text" name="txtName" value="Name"> </form> and Request.Form("txtName") will contain "Name" -and- Request.QueryString("data") will contain "value"

1) HTTP GET: In HTTP GET method data passed through URL querystring using name value pair. It's simpler and you can troubleshoot any problems simply by looking at the address bar in your browser because all values passed are displayed there. This is also the primary weakness of this method.2) HTTP POST: In HTTP POST request data are embeded in a HTTP HEADER. So data are NOT visible to end user while you can see the data passed in HTTP GET method. So if you want to pass sensitive information/data, you should have to use HTTP POST request. Another advantage is that you can send larger amounts of information compare to HTTP GET method.

Normally in javascript you get dynamic data from servers using a GET method and you send dynamic data to the servers using POST method. Ofcourse do not assume that they cannot be interchanged cause essentially both send some form of data to the servers.

what are the differents between preindexing and post indexing?

The $_POST array contains only variables supplied by a form that used the POST method, while the $_REQUEST array combines the $_POST, $_GET and $COOKIE arrays.

what a wicked page, really helpfull Difference between pre-tensioned and post-tensioned?

The difference between modernism and post modernism are the highlights and approaches towards life. It also differs in the ways of thinking that led to these movements.

If your form has security items (like username, password) use POST method. Because post method is more secure. Otherwise you can use GET method. Also GET method is faster than POST method.

This blog post sums it up. basically they differ based on what each animal eats

In computing terms - A 'thread' is a topic of discussion, and a 'post' is a response to the 'thread'.

// getFirst name: Last name: Click the "Submit" button and the input will be sent to a page on the server called "form_action.asp".//postThe form-data can be sent as URL variables (with method="get") or as HTTP post (with method="post").Notes on the "get" method:This method appends the form-data to the URL in name/value pairsThis method is useful for form submissions where a user want to bookmark the resultThere is a limit to how much data you can place in a URL (varies between browsers), therefore, you cannot be sure that all of the form-data will be correctly transferredNever use the "get" method to pass sensitive information! (password or other sensitive information will be visible in the browser's address bar)Notes on the "post" method:This method sends the form-data as an HTTP post transactionForm submissions with the "post" method cannot be bookmarkedThe "post" method is more robust and secure than "get", and "post" does not have size limitations

In forum you can participate in discussion on particular topic and Blog is an online diary where anyone can post their comment.

"Post Dramatic Stress" is a misunderstanding of the term Post Traumatic Stress. They are the same thing.

Post graduate degree is for 2 year and post graduate diploma is for 1 year

Do you know? If so, edit this and post the answer!

doPost() is the method in the servlet that is used to service the Http requests submitted using the Post option. HTML forms can be submitted in two ways using the Get method and the Post method. You can specify the method while declaring the form itself. So you will have two methods in the servlet doGet() and doPost() each for one of them

Pre-production is before production. Post-production is after production.

A bank handles money and a post office handles letters and packages.

Post is towards the center of the field, flag is toward the sideline.

Copyright ยฉ 2021 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.