Skip navigation.

exploreopera

| Help

Sign up | Help

HTTP spec overview

, ,

Just because I find the HTTP spec so confusing at times and badly needed an overview:
http://www.hallvord.com/pc/http-cheat-sheet.htm

On being a user agentAnniversary

Comments

avatar
Nice, I have to bookmark this. :smile:

By Frenzie, # 31. January 2006, 10:49:34

avatar
You're welcome! :-)
I should warn you that I'm not an expert on HTTP, I think I generally got things right but consult the spec if in doubt.. p:

By hallvors, # 31. January 2006, 14:26:20

avatar
Even in 2006, people continue giving their files the three-letter extension "htm". Why? Just in case there's an MS-DOS user somewhere?

Actually, it's better to omit the extension from the link completely. This link works, too:
http://www.hallvord.com/pc/http-cheat-sheet
(If there are several files with different extensions available, content negotiation happens.)

By feldgendler, # 1. February 2006, 04:04:27

avatar
Why end a link with .htm? well, firstly I like showing nerds like myself what sort of content the link will give you. You know, I'd hover a link ending with .pdf a little while thinking about whether I really want Adobe Reader to open when I have X other programs open. Something.exe when you don't expect a download smells fishy. That sort of thing.

.htm over .html is just a habit.

My site is configured for content negotiation as you just found out, but I've learnt the hard way NOT to rely on it - the algorithm seems a bit complicated and in practice Apache 1.3 is thoroughly confused by my old habit of naming files index.js or index.css along with index.htm . Depending on the UA's accept headers I've seen Apache serve pure CSS or JavaScript instead of the expected HTML page. Perhaps it's my fault for using similar file names but hey, the tool should cope with my quirks and not the other way around.

Another Apache CN quirk is that if you have a directory and a file with the same name, redirection to the directory always wins. So if you have

/books/
/books.en.htm
/books.no.htm

and request /books you're sent to the directory without any content negotiation.

Even when content-negotiation works it causes problems - because I tried to use it for language negotiation and Apache would often not be able to decide what language to send - even if only one file was available! Hence, it would show a 406 error page, and IE would show it's friendly error page as if it was a 404. Well, blame IE but seriously - I can't have a site where IE tells visitors half of the pages are not found!

Given all these issues I usually keep extensions on my links, thank you very much.

By hallvors, # 2. February 2006, 15:27:05

avatar
I'd hover a link ending with .

By qicaispace, # 29. May 2006, 03:40:31

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.