get and post methods

13

Upload: baabtracom-no-1-supplier-of-quality-freshers

Post on 03-Jul-2015

308 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Get and post methods
Page 2: Get and post methods

Title of the presentation

Anjali G

[email protected]

www.facebook.com/Anjali Geetha

twitter.com/username

in.linkedin.com/in/Anjali G

9497879952

Page 3: Get and post methods

METHODS GET AND POST

Page 4: Get and post methods

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

Page 5: Get and post methods

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

Page 6: Get and post methods

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.

Page 7: Get and post methods

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

Page 8: Get and post methods

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. . .

Page 9: Get and post methods

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.

Page 10: Get and post methods

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..

Page 11: Get and post methods

THANK YOU

Page 12: Get and post methods

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

Page 13: Get and post methods

Contact Us

Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

Start up VillageEranakulam,Kerala, India.

Email: [email protected]