Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of GET and POST?

 
Ryan McClain
Ranch Hand
Posts: 145
1
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 145
1
  • Mark post as helpful
  • send pies
  • 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?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only the URL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic