Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide


NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Enjoy The TCP/IP Guide? Get the complete PDF!
The TCP/IP Guide

Custom Search







Table Of Contents  The TCP/IP Guide
 9  TCP/IP Application Layer Protocols, Services and Applications (OSI Layers 5, 6 and 7)
      9  TCP/IP Key Applications and Application Protocols
           9  TCP/IP File and Message Transfer Applications and Protocols (FTP, TFTP, Electronic Mail, USENET, HTTP/WWW, Gopher)
                9  TCP/IP World Wide Web (WWW, "The Web") and the Hypertext Transfer Protocol (HTTP)
                     9  TCP/IP Hypertext Transfer Protocol (HTTP)
                          9  HTTP Entities, Transfers, Coding Methods and Content Management

Previous Topic/Section
HTTP Data Length Issues, "Chunked" Transfers and Message Trailers
Previous Page
Pages in Current Topic/Section
1
2
3
Next Page
HTTP Features, Capabilities and Issues
Next Topic/Section

HTTP Content Negotiation and "Quality Values"
(Page 2 of 3)

Comparing Negotiation Methods

To draw an analogy, suppose a co-worker offers to go out at lunch-time to pick up lunch for the two of you, at a new restaurant where neither of you have eaten before. You could provide him with some parameters regarding what you like to eat—“I like roast beef sandwiches, fish & chips, and pizza, but not chicken”—and then trust him to pick something you will like. Or, he could go to the restaurant, call you on his cell phone, and read the menu to you and let you make a selection. This first is like server-driven negotiation; the second, like agent-driven negotiation.

I think this is a good analogy not only because it (hopefully) helps you see the differences between the two methods, but it also highlights the key advantages and disadvantages of each. Trusting your co-worker with your lunch selection is simple and efficient, but not foolproof. It’s possible that the restaurant may not have any of the items you specified, or that your friend may get you something containing another ingredient that you don’t like but that you forgot to mention. Similarly, server-based negotiation is a “best-guess” process that does not guarantee that the client will receive the resource in the format it wants. This is exacerbated by the fact that there are only so many ways for the client to specify its preferences using a handful of request headers.

Agent-based negotiation, on the other hand, allows the client to select exactly what it wants from the available choices, just as you can choose your favorite dish from the menu of the restaurant. The problem here is that it is inefficient, because two requests and responses are required for each resource access. (Would you really want to read a restaurant’s menu over the phone to someone so they could choose their ideal dish? J)

Key Concept: HTTP includes a feature called content negotiation that allows the selection of a particular variation of a resource that has more than one representation. There are two negotiation techniques: server-driven, where the client includes headers in its request that indicate what it wants and the server does its best to select the most appropriate variant; and agent-driven, where the server sends the client a list of the available resource alternatives and the client chooses one.


Server-Based Negotiation in HTTP

In practice, server-based negotiation is the type that is most commonly used today. The client specifies its preferences using a set of four request headers that indicate what it would prefer in the representation of the resource. The headers each represent one characteristic of a resource: Accept (media type); Accept-Charset (character set); Accept-Encoding (content encoding); and Accept-Language (resource language). Any or all of these may be included in the request.

Each “Accept-” header contains a list of acceptable values that is appropriate to the characteristic that it specifies, separated by a comma. For example, the Accept header lists media types the client considers acceptable, while Accept-Language contains language tags. Suppose you have a friend who is trilingual in English, French and Spanish. She can read a particular document in any of these languages, so she might instruct her browser to include the following header in her requests:

Accept-Language: en, fr, sp

Previous Topic/Section
HTTP Data Length Issues, "Chunked" Transfers and Message Trailers
Previous Page
Pages in Current Topic/Section
1
2
3
Next Page
HTTP Features, Capabilities and Issues
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005

© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.