Skip to main content
Visual C++ Samples 
ShowAccept 

Demonstrates how to read the HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, and HTTP_ACCEPT_CHARSET request headers and order the elements according to the user's preference.

View ShowAccept.srf in a browser to see the MIME types, languages, character sets, and encodings that your browser indicates are acceptable in the request that it sent to the server. Change your browser's language settings to see that the server recognizes the priority you give to each language. In Internet Explorer, you can change your language settings. On the Tools menu, click Internet Options. On the General tab, click Languages and select the appropriate language settings.

The code parses each of the HTTP_ACCEPT_* headers into its separate components. The elements of the request header are added to a collection ordered by their priority value. The collections are then displayed in a table.

Demonstrates