• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

First exercise in HFSJ

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to double-check the answers of the first exercise in HFSJ. I know it is simple, but I cant find the answers. I would definitely like to know if I answered them correctly. For each description, we need to select if we would use GET or POST. My answers are next to the descriptions.

1.) A user returning a login name and password - POST
2.) A user is requesting a new page via a hyperlink - GET
3.) A chat room user is sending a written response - POST
4.) A user hits the 'next' button to see the next page - GET
5.) A user hits the 'log out' button on a secure banking site - POST
6.) A user hits the 'back' button on the browser - GET
7.) A user sends a name and address form to the server - POST (I chose POST because it uses the word 'form', else I could have gone with GET also)
8.) A user makes a radio button selection - Either POST or GET
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi shameen,
Ur all answers are correct but i would like to add a cooment to this answer

7.) A user sends a name and address form to the server - POST (I chose POST because it uses the word 'form', else I could have gone with GET also)



your are right as it mentioned "form" but the reason is that in case of GET the content/values of ur page will be transmitted with the Request Line (in POST it is transmitted as PayLoad) which has vary limited size.
Since u r submitting a form so the content may exceed that of GET Reguest line allowed size so better to send it through POST method

Correct me if i am wrong

regards
-santosh
 
Shameen MK
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Santosh. The reason why I mentioned that I could have used GET also for point 7 is that there are only two fields mentioned i.e. Name and Address which is too less and can be adjusted in the GET request. Although, I do agree that POST is a better way in such cases.

Thanks a lot.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic