Hi, I am little bit confuse between get method or post method, So tell me what is the difference between get or post method.
GET and POST are both ways to send data from your client to your server page. GET = the data being sent to your server is coded into the URL. e.g site. com/page.aspx?key=value POST = the data being sent is hidden from the user's eye (he can inspect it but its not as visual as GET) e.g site. com/page.aspx anyhow, both of these are accessible the same way via ASP.NET, both are inside the Request struct. the recommendation is ofcourse to use POST if you dont have a reason to use GET, besides when dealing with query forms (search boxes etc) and such where the user then benefits from seeing his query, can change it via the browser's address bar etc etc.
Both are used to send data of the form to the another server page When you use get method variables of the form will be displayed in the addressbar of the browser and in post methid it will not be displayed
GET - Requests data from a specified resource POST - Submits data to be processed to a specified resource
GET get data from server, POST send data to server, DELETE its to send delete command to server to delete something and finally you have PUT.
Hello friends, so many developer confused he/she said that get is used for get the data from server and post is used for post the data in server this is totally wrong(in starting i am also said this ). But Both Get and Post Method are form submission method.it is used for send the data from client side to server side. The Second Question where it is . The method is inside the form tag like below syntax is like below <form method="get||post"> you use single method name get or post Third Question is ByDefault which method is used Ans is By default Get method are used
Two HTTP Request Methods: GET and POST Two commonly used methods for a request-response between a client and server are: GET and POST. GET - Requests data from a specified resource POST - Submits data to be processed to a specified resource The GET Method Note that query strings (name/value pairs) is sent in the URL of a GET request: /test/demo_form.asp?name1=value1&name2=value2 Some other notes on GET requests: GET requests can be cached GET requests remain in the browser history GET requests can be bookmarked GET requests should never be used when dealing with sensitive data GET requests have length restrictions GET requests should be used only to retrieve data The POST Method Note that query strings (name/value pairs) is sent in the HTTP message body of a POST request: POST /test/demo_form.asp HTTP/1.1 Host: w3schools.com name1=value1&name2=value2 Some other notes on POST requests: POST requests are never cached POST requests do not remain in the browser history POST requests cannot be bookmarked POST requests have no restrictions on data length
Difference between GET and Post: GET Data will be arranged in HTTP header by appending to the URL as query string Data is in query string so user can view the data Less secured compared to POST method because data is in query string so it will be saved in browser history and web server logs As data is saved in URL so its saves only 2048 bytes data Can be bookmarked Hacking will be easy POST Data will be arranged in HTTP message body. Not visible to user Bit safer than GET method because data is not saved in history or web server logs Can be used for any amount of data Can’t bookmarked Hacking is difficult
As for the "hacking is difficult" with post-data , that's wrong. It's just as easy as hacking get-data, you just need to change or create your own form which then posts to the form processor. Slightly harder, but not difficult. Which is why you ALWAYS need to secure the form handler server side.
Forms in HTML can use either method by specifying method=”POST” or method=”GET” in the <form>element. Key points about GET method GET - Allow only ASCI character data type It is not secure but GET methods fast & quickly working Here in this method restrictions on form data length Syntax: <form method=”GET” action=”abc.aspx”> Data can be cached in get method Key points about POST method POST – Allows also binary data It is secure but slower than GET method Syntax: <form method=”post” action=” abc.aspx”> Here in this method no restriction on form data length Data cannot cached in post method
I will give a technical explanation just to add my $.02. A web server uses the HTTP protocol to communicate with web clients. The HTTP protocol defines many methods. GET and POST are the two most popular, but they are not the only methods. We have PUT, DELETE, and HEAD just to name a few. If you are talking from the perspective of an HTTP client like a web browser, then GET is used to retrieve (get) a resource (HTML page, image, CSS) from the webserver server. When you send a GET request to the server you can pass parameters in the URL to tell the server what to retrieve. The POST request, on the other hand, is used to send (post) data (form data, file upload) to a server. You can basically send arbitrary data to the server using POST.