Get and post methods

BaabtraMentoringPartner 3,910 views 13 slides Aug 12, 2013
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

No description available for this slideshow.


Slide Content

Title of the presentation Anjali G [email protected] www.facebook.com/Anjali Geetha twitter.com/username in.linkedin.com/in/ Anjali G 9497879952

METHODS GET AND POST

introduction Get and Post are HTTP request methods to transfer data from client to server. HTTP works as a request-response protocol between a client and server. Get - Requests data from a specified resource Post - Submits data to be processed to a specified resource Both GET and POST can be used to send request and receive response

GET METHOD GET requests can be cached The GET method means retrieve whatever information (in the form of an entity ) is identified by the Request-URI . GET requests remain in the browser history GET can't be used to send binary data, like images or word documents, to the server . 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 Eg : http://www.example.com/servlet?foo=bar

Post method 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 The POST method can be used to send ASCII as well as binary data . The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using Secure HTTP you can make sure that your information is secure.

Compare get vS post GET POST BACK button/Reload Harmless Data will be re-submitted (the browser should alert the user that the data are about to be re-submitted) Bookmarked Can be bookmarked Cannot be bookmarked Cached Can be cached Not cached History Parameters remain in browser history Parameters are not saved in browser history

GET POST Restrictions on data length Yes, when sending data, the GET method adds the data to the URL; and the length of a URL is limited (maximum URL length is 2048 characters) No restrictions Restrictions on data type Only ASCII characters allowed No restrictions. Binary data is also allowed Security GET is less secure compared to POST because data sent is part of the URL Never use GET when sending passwords or other sensitive information! POST is a little safer than GET because the parameters are not stored in browser history or in web server logs Visibility Data is visible to everyone in the URL Data is not displayed in the URL CONTINUE. . .

ADVANTAGES OF GET Save the results of a form submission. For example, you can submit data and bookmark the resultant URL, send it to a colleague by email, or put it in a normal hypertext link. The ability to bookmark the results page is the main reason google.com, yahoo.com, and other search engines use GET . Type data in by hand. You can test Servlets or JSP pages that use GET simply by entering a URL with the appropriate data attached.

ADVANTAGES OF POST Transmit large amounts of data. Many browsers limit URLs to a few thousand characters, making GET inappropriate when your form must send a large amount of data. Since HTML forms let you upload files from the client machine, sending multiple megabytes of data is quite commonplace. Only POST can be used for this task . Send binary data. Spaces, carriage returns, tabs, and many other characters are illegal in URLs. If you upload a large binary file, it would be a time-consuming process to encode all the characters before transmission and decode them on the other end .   Keep the data private from someone looking over the user’s shoulder ..

Thank you

If this presentation helped you, please visit our page  facebook.com/ baabtra  and like it. Thanks in advance .    www.baabtra.com  |  www.massbaab.com  | www.baabte.com

Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam , Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam , Kerala, India. Email: [email protected]
Tags