• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could anybody help me

 
Suniljava Sharma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am unable to sort out properly where to use get and where post in questions given at page 19 of HFSJ.So please tell me the answers with reasons.

Thanks
Sunil
 
Suchen Chodankar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Whenever we have to send any kind of data to the server for example form submission we have to use POST method and GET method is used to request for any resource from the server.

I think you should be able to figure out answer to questions on page 19 by yourself.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The GET method is Idempotent in HTTP sepecification means that multiple GET requests doesn't change the state of the server whereas POST is non-Idempotent.

In GET the data is passed in query string which is visible in the address bar of browser, so don't send data through GET which you don't want user to see, like username/password in case of login page, use POST in this case.

Similarly, there are places where you should use GET like in a search page, if you are providing a search page to user where he/she can search things depending upon some keyword or criteria, you should use GET for that so that user can bookmark the page and in future if he/she wants to use the same search criteria he/she can come to it directly whereas if you use POST in this scenerio the search criteria can not be book marked.

These are some of the cases, however now you can think more by yourself
 
Suniljava Sharma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ali and suchen for quick response.
Just one query is here if i am going back to previous page by using Back arrow(or Alt+left arrow) then which method must be used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic