Hypertext Style: Cool URIs don't change.

W3C Style Guide


Get and POST: what needs a URI and what doesn't

There are two ways of getting from one web page to another, and the differnce between them is very important.

GETting: Nothing happens

The normal way is to follow a link. The link carries the URI of a difffrent page,, and the browser diplays it. This is the simple story of two web pages.

There is a completely different thing which happens when you push buttons on certin forms. ThSome forms just go to a web page which depends on what you have entered on the form. Search forms typically work like that. You can bookmark the form, and you can also bookmark the place you getto when you press the submit button.

These pages all have URIs. You can read them again and again, and nothing untoward happens. The tem for what happens when you read it is GET.

POSTing: Something happens.

The second way is a special operation (called POST) when the form information is sned to spme processing engine in a server, and something happens. By "something happens", I don't meann that you just see a new page: I mean hat something has happened elsewhere. Your shopping cart has got an extra thing in it. You agree to order something. You subscribe to a list. You pay someone. You vote.

These actions are change things. If you do them twice, it isn't the same as do. ing them once!

The page you see as a result of the POST is not something you can bookmarl It is like a recipt. You can't just make a link to it, as you can only get that page by posting the same operation.

A POST is a bit like signing something.

Clearly you don't want to confuse signing a document with reading it.

In fact, many web sites at the moment get these two types of page muddled and the result ican be a big mess.

Using POST when you should use GET.

My bank's home banking site is an example of a very frustrating site which doesn't get it.


(back to Etiquette for server administrators, on to Structure of your work)

foobar

©1998 Tim BL