• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Usage of GET and POST?

 
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding: book Head First Servlets & JSP, page 111, second paragraph.

1) What is meant by 'cannot be bookmarked'? I could as well just go to a form POST page and bookmark it, but then it wouldn't work because when I would visit it again, e.g. the form data would be gone.

2) "The users might want to come back a week later and try the same search again now that there's new data on the server". What does this mean? Does it mean that it woul be bad to allow a GET request on a search box? I see it as an advantage of not having to fill in the search terms again.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Yes, bookmarking a POST is not all that useful. That's why a pattern like the PRG Pattern (described in this article) is preferred. That way, dangling POSTs are never left on the page for people to bookmark. It also prevents an annoying browser message when refreshing, or the accidentally replaying of destructive POST action.

2) I believe it's saying that bookmarking the GET with its complete URL is a good thing as it's easy for the user to "replay" the search at a later time.
 
Ryan McClain
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you bookmark something, what is actually being bookmarked? Just the request line (GET http://path.to/resource.ext?querystring) - or are headers and the body bookmarked as well?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only the URL.
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic