• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which request is better Get or Post?

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please validate these scenarios for Get/Post:Some are taken fronm HFJS ,first chapter

1)User is returning a login name and a password---post
2)Requesting a new page via a hyperlink---get
3)Chat room user sends a written repsponse---post
4)User hits the next button to see the page---get/post ?
5)user hits a logout button on secure banking site---post
6)User hits a back button on the browser---get
7)User sends a name and address form to the server---post
8)User makes a radio button selection---get/post?
9)User refreshes the page from the broswer refresh--get/post?
10)user types a url in broser and hits enter-get

 
Aurelian Tutuianu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems they are ok.
Usually you should use POST when you are handling big quantity of data (GET is very limited) or there are data that you don't want to be seen (security sensitive, personal information, etc). GET is faster.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
4)User hits the next button to see the page---get/post ?

GET seems reasonable, but POST is certainly a possibility.

6)User hits a back button on the browser---get

The browser may retrieve the page from the cache without accessing the server again. If the browser chooses to get the page from the server, then whatever was used to get it before will be used.

8)User makes a radio button selection---get/post?

A form submission will generally be done using a POST.

9)User refreshes the page from the broswer refresh--get/post?

Whatever was used to retrieve the page in the first place will be used.
 
Nicky McGrath
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just read the same questions in the chapter and the one which I wasn't sure about was:

8) User makes a radio button selection


Selecting the radio button itself does not cause a form submission so if I saw this in an exam, I would be concerned it was a trick question (although yes, technically there are no trick questions).

If worded as:
8) User makes a radio button selection then submits the form/page

Then a GET or POST method could be used. A POST is likely to be the most appropriate.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic