亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch02_06.htm

?? 用perl編寫CGI的好書。本書從解釋CGI和底層HTTP協議如何工作開始
?? HTM
字號:
<?label 2.6. Content Negotiation?><html><head><title>Content Negotiation (CGI Programming with Perl)</title><link href="../style/style1.css" type="text/css" rel="stylesheet" /><meta name="DC.Creator" content="Scott Guelich, Gunther Birznieks and Shishir Gundavaram" /><meta scheme="MIME" content="text/xml" name="DC.Format" /><meta content="en-US" name="DC.Language" /><meta content="O'Reilly & Associates, Inc." name="DC.Publisher" /><meta scheme="ISBN" name="DC.Source" content="1565924193L" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="CGI Programming with Perl" /><meta content="Text.Monograph" name="DC.Type" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" alt="Book Home" usemap="#banner-map" border="0" /><map name="banner-map"><area alt="CGI Programming with Perl" href="index.htm" coords="0,0,466,65" shape="rect" /><area alt="Search this book" href="jobjects/fsearch.htm" coords="467,0,514,18" shape="rect" /></map><div class="navbar"><table border="0" width="515"><tr><td width="172" valign="top" align="left"><a href="ch02_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td width="171" valign="top" align="center"><a href="index.htm">CGI Programming with Perl</a></td><td width="172" valign="top" align="right"><a href="ch02_07.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><hr align="left" width="515" /><h2 class="sect1">2.6. Content Negotiation</h2><p>People from <a name="INDEX-457" /> <a name="INDEX-458" /> <a name="INDEX-459" /> <a name="INDEX-460" />all over the world access the sameInternet, using many different languages, many different charactersets, and many different browsers. One representation of a documentis not going to satisfy the requirements of all these people. This iswhy HTTP provides something called <em class="firstterm">contentnegotiation</em>, which allows clients and servers tonegotiate the best possible format for each given resource.</p><p>For example, say you want to <a name="INDEX-461" />make a document available in multiplelanguages. You could store each translation of this documentseparately so that they each have a unique URL. This would be a badidea for a number of reasons, but most importantly because you wouldhave to advertise multiple URLs for the same resource. URLs have beendesigned to be easily exchanged offline as well as via hyperlinks,and there is no reason why people who speak different languagesshould not be able to share the same URL. By utilizing contentnegotiation, you can offer the appropriate translation of a requesteddocument automatically.</p><p>There are four primary forms of content negotiation: language,<a name="INDEX-462" />character set,<a name="INDEX-463" /><a name="INDEX-464" />media type, and encoding. Each have theirown corresponding headers, but the negotiation process works the sameway for all of them. Negotiation can be performed by the<a name="INDEX-465" /><a name="INDEX-466" />server or by the client. Inserver-side negotiation, the client sends a header indicating theforms of content it accepts, and the server responds by selecting oneof these options and returning the resource in the appropriateformat. In client-side negotiation, the client requests a resourcewithout special headers, the server sends a list of the availablecontents to the client, the client then makes an additional requestto specify the format of the resource desired, and the server thenreturns the resource in that format. Clearly there is more overheadin client-side negotiation (although caching helps), but the clientis generally better than the server at choosing the most appropriateformat.</p><a name="ch02-32-fm2xml" /><div class="sect2"><h3 class="sect2">2.6.1. Media Type</h3><p><a name="INDEX-467" /> <a name="INDEX-468" />Clients mayinclude a<a name="INDEX-469" /><a name="INDEX-470" />header with theirHTTP request indicating a list of preferred formats. The header formedia type looks like this:</p><blockquote><pre class="code">Accept: text/html;q=1, text/plain;q=0.8,         image/jpeg, image/gif, */*;q=0.001</pre></blockquote><p>The <em class="emphasis">Accept</em><a name="INDEX-471" /> header list contains HTTP media types inthe <em class="emphasis">type/subtype</em> format used by the<a name="INDEX-472" /><em class="emphasis">Content-Type</em> header,followed by optional <a name="INDEX-473" /> <a name="INDEX-474" />qualityfactors (asterisks serve as wildcards). Quality factors arefloating-point numbers betweenand 1 that indicate a preference for a particular type; the defaultis 1. Servers are expected to examine the <em class="emphasis">Accept</em>media types and return data that is preferred by the browser. Whenmultiple values have the same quality factor, the more specific one(i.e., where the quality factor is specified or the media type is nota wildcard) has higher priority.</p><p>In the previous example, documents would be returned with thefollowing priority:</p><ol><li><p><em class="emphasis">text/html</em><a name="INDEX-475" /></p></li><li><p><em class="emphasis">image/jpeg</em><a name="INDEX-476" /> or <em class="emphasis">image/gif</em></p></li><li><p><em class="emphasis">text/plain</em><a name="INDEX-477" /></p></li><li><p><em class="emphasis">*/*</em><a name="INDEX-478" /> (anything else)</p></li></ol><p>In reality, media type negotiation is not often used because it isunwieldy for a browser to list the media types of all documents itsupports each time it makes a request. The majority of browsers todayspecify only new or less common <a name="INDEX-479" /><a name="INDEX-480" />image formats in addition to<em class="emphasis">*/*</em>. Examples of the newer formats are<em class="emphasis">image/p-jpeg</em> (progressive JPEG) or<em class="emphasis">image/png.</em> (PNG was created as an openalternative to GIF, which has patent issues; see <a href="ch13_01.htm">Chapter 13, "Creating Graphics on the Fly"</a>). Web servers generally do not support mediatype negotiation for static documents, but we will look at a CGIscript that does this in the next chapter.</p></div><a name="ch02-33-fm2xml" /><div class="sect2"><h3 class="sect2">2.6.2. Internationalization</h3><p>Although media type negotiation is becoming outdated, other forms of<a name="INDEX-481" /><a name="INDEX-482" />contentnegotiation are gaining much more importance. Internationalizationhas become a new arena where content negotiation plays an importantrole. Providing a document to members of other countries can mean twothings: supporting other translations and possibly supporting other<a name="INDEX-483" />character sets. The Romanalphabet, the Cyrillic alphabet, and Kanji, for example, usedifferent character sets. HTTP supports these forms of negotiationwith the <a name="INDEX-484" /><em class="emphasis">Accept-Language</em> and<em class="emphasis">Accept-Charset</em> headers. Examples of theseheaders are:</p><blockquote><pre class="code">Accept-Charset: iso-8859-5, iso-8859-1;q=0.5Accept-Language: ru, en-gb;q=0.5, en;q=0.4</pre></blockquote><p>The first line indicates that the server should return the content inCyrillic if possible or Western Roman otherwise. The languagespecifies Russian as the first choice, with British English as thesecond, and other forms of English as the third. Note that a singleasterisk can be used in place of any of these values to represent awildcard match. The default character set, unless specified, isUS-ASCII or ISO-8859-1 (US-ASCII is a subset of ISO-8859-1).</p><p>Most web servers support language negotiation automatically for<a name="INDEX-485" /><a name="INDEX-486" />static documents. For example, ifyou perform a new installation of Apache, it will install multiplecopies of the "It Worked!" welcome file in<em class="filename">/usr/local/apache/htdocs</em>. The files all sharethe <em class="filename">index.html</em> base name but have differentextensions indicating the <a name="INDEX-487" /><a name="INDEX-488" />language code:<em class="filename">index.html.en</em>,<em class="filename">index.html.fr</em>,<em class="filename">index.html.de</em>, etc. If you point your browser at<em class="filename">index.html</em>, change the preferred language inyour browser, and then reload the page, you should see it in anotherlanguage.</p></div><a name="ch02-34-fm2xml" /><div class="sect2"><h3 class="sect2">2.6.3. Encoding</h3><p>The final form of <a name="INDEX-489" /><a name="INDEX-490" />content negotiation supportsencoding. Options for encoding include<em class="firstterm">gzip</em><a name="INDEX-491" /><a name="INDEX-492" /><a name="INDEX-493" />,<em class="firstterm">compress</em>, and <em class="firstterm">identity</em>(no encoding). Here is an example header specifying that the browsersupports <em class="emphasis">compress</em> and <em class="emphasis">gzip</em>:</p><blockquote><pre class="code">Accept-Encoding: compress, gzip</pre></blockquote><p>A server may be able to speed up the download of a large document tothis client by sending an encoded version of the document. Thebrowser should decode the document automatically for the <a name="INDEX-494" /> <a name="INDEX-495" /> <a name="INDEX-496" /> <a name="INDEX-497" />user.</p></div><hr align="left" width="515" /><div class="navbar"><table border="0" width="515"><tr><td width="172" valign="top" align="left"><a href="ch02_05.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td width="171" valign="top" align="center"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td width="172" valign="top" align="right"><a href="ch02_07.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td width="172" valign="top" align="left">2.5. Proxies</td><td width="171" valign="top" align="center"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td width="172" valign="top" align="right">2.7. Summary</td></tr></table></div><hr align="left" width="515" /><img src="../gifs/navbar.gif" alt="Library Navigation Links" usemap="#library-map" border="0" /><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2001</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area href="../index.htm" coords="1,1,83,102" shape="rect" /><area href="../lnut/index.htm" coords="81,0,152,95" shape="rect" /><area href="../run/index.htm" coords="172,2,252,105" shape="rect" /><area href="../apache/index.htm" coords="238,2,334,95" shape="rect" /><area href="../sql/index.htm" coords="336,0,412,104" shape="rect" /><area href="../dbi/index.htm" coords="415,0,507,101" shape="rect" /><area href="../cgi/index.htm" coords="511,0,601,99" shape="rect" /></map></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久精品日日躁夜夜躁欧美| 亚洲国产精品视频| 日韩欧美国产精品一区| 欧美日韩精品二区第二页| 色综合婷婷久久| 色婷婷综合久久| 在线观看日产精品| 91精品91久久久中77777| 色妞www精品视频| 欧美午夜片在线观看| 欧美日韩国产高清一区| 91精品国产免费| 精品国产乱码久久久久久牛牛 | 国产一区二区导航在线播放| 日韩中文字幕区一区有砖一区 | 白白色亚洲国产精品| 成人毛片视频在线观看| 94色蜜桃网一区二区三区| 色综合久久综合| 制服丝袜日韩国产| 精品卡一卡二卡三卡四在线| 国产女人18水真多18精品一级做| 亚洲国产精品99久久久久久久久| 亚洲欧美日韩系列| 日韩av不卡在线观看| 国产精品香蕉一区二区三区| youjizz久久| 宅男在线国产精品| 国产精品午夜在线观看| 亚洲一区二区三区国产| 韩国女主播成人在线观看| 成人精品视频一区二区三区 | 青青草伊人久久| 国产精品18久久久久久久久 | 日韩欧美三级在线| 国产精品初高中害羞小美女文| 亚洲国产视频a| 激情欧美一区二区| 91久久精品国产91性色tv| 日韩欧美色综合网站| 国产亚洲精品bt天堂精选| 一区二区三区在线免费播放 | 欧美国产日本视频| 亚洲成人动漫一区| 成人亚洲一区二区一| 日韩一区二区三区免费看| 国产精品传媒视频| 国产制服丝袜一区| 欧美日韩一区二区在线视频| 亚洲国产高清aⅴ视频| 日韩av中文字幕一区二区| av中文字幕亚洲| 久久久久久毛片| 日韩精品福利网| 欧日韩精品视频| 国产精品女主播av| 国产精一区二区三区| 欧美卡1卡2卡| 亚洲香肠在线观看| av福利精品导航| 国产拍揄自揄精品视频麻豆| 日产国产高清一区二区三区| 欧日韩精品视频| 亚洲婷婷综合色高清在线| 国产精品18久久久久| 精品国产伦理网| 卡一卡二国产精品| 在线播放日韩导航| 日韩精品一二三| 欧美电影在哪看比较好| 亚洲自拍偷拍综合| 在线观看国产91| 一区二区三区四区激情| 色猫猫国产区一区二在线视频| 国产精品国产自产拍高清av王其| 懂色av一区二区三区蜜臀| 国产日韩欧美精品综合| 国产大陆精品国产| 国产午夜精品久久久久久久| 国产剧情一区二区| 中文字幕精品在线不卡| 成人午夜碰碰视频| 亚洲人精品午夜| 欧美亚洲一区三区| 日产国产欧美视频一区精品| 日韩欧美色综合网站| 日本人妖一区二区| 91精品国产综合久久国产大片| 午夜电影一区二区| 日韩精品一区二区三区老鸭窝| 裸体一区二区三区| 国产欧美一区二区精品仙草咪| 成人综合婷婷国产精品久久蜜臀 | 伊人色综合久久天天| 欧美吞精做爰啪啪高潮| 日本中文在线一区| 精品久久久久av影院| 国产白丝精品91爽爽久久| 综合电影一区二区三区| 欧美午夜一区二区三区免费大片| 偷窥少妇高潮呻吟av久久免费| 日韩一卡二卡三卡四卡| 国产精品1区2区| 亚洲一级二级三级在线免费观看| 欧美一区二区三区四区视频| 国产精品一区二区无线| 亚洲丝袜精品丝袜在线| 欧美一区二区视频网站| 粉嫩av一区二区三区| 亚洲国产日韩一区二区| www国产成人免费观看视频 深夜成人网| 春色校园综合激情亚洲| 一二三区精品视频| 欧美精品一区二| 色狠狠综合天天综合综合| 久久99久久99| 亚洲女人****多毛耸耸8| 欧美成人精品福利| 色综合中文字幕| 精品一区二区三区蜜桃| 亚洲精品久久久久久国产精华液| 精品国内二区三区| 欧美色网一区二区| 不卡一二三区首页| 九九热在线视频观看这里只有精品| 亚洲欧美激情小说另类| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美一a一片一级一片| 国产精品1区2区3区| 免费在线看一区| 五月激情综合色| 亚洲特黄一级片| 中文字幕乱码一区二区免费| 日韩欧美一区二区久久婷婷| 欧美午夜精品久久久久久孕妇| 成人一道本在线| 国产精品亚洲午夜一区二区三区| 亚洲国产精品久久久久婷婷884| 国产精品久久久久婷婷二区次| 日韩欧美不卡一区| 欧美一区二区三区的| 欧美性一区二区| 色老汉av一区二区三区| 99国产麻豆精品| 成人爽a毛片一区二区免费| 国产毛片精品一区| 久久99国产精品久久99| 五月婷婷激情综合| 香蕉成人伊视频在线观看| 伊人开心综合网| 亚洲国产一区二区在线播放| 亚洲另类在线视频| 亚洲欧美激情小说另类| 亚洲欧美在线视频观看| 中文字幕在线观看不卡视频| 欧美国产激情二区三区| 国产亚洲va综合人人澡精品| 久久综合中文字幕| 国产欧美一区视频| 国产欧美视频一区二区三区| 久久嫩草精品久久久精品| 久久免费电影网| 中文字幕国产一区二区| 国产精品成人免费在线| 亚洲美女屁股眼交| 亚洲一区免费视频| 午夜免费久久看| 精品在线播放午夜| 成人自拍视频在线| 91在线精品一区二区| 色婷婷久久久综合中文字幕| 欧洲精品视频在线观看| 欧美精品一卡二卡| 日韩三级伦理片妻子的秘密按摩| 久久视频一区二区| 中文字幕一区二区三区在线不卡| 综合中文字幕亚洲| 亚洲国产一区视频| 久久精品国产第一区二区三区| 国产很黄免费观看久久| av爱爱亚洲一区| 欧美精品三级在线观看| 久久日韩精品一区二区五区| 亚洲欧美综合在线精品| 亚洲伊人色欲综合网| 经典三级视频一区| 99久久er热在这里只有精品66| 在线成人免费视频| 国产日韩欧美不卡在线| 一区二区三区国产精品| 国产一区二区三区观看| 日本韩国欧美在线| 久久久午夜精品| 亚洲高清久久久| 懂色av一区二区三区免费观看| 6080国产精品一区二区| 国产精品毛片高清在线完整版| 日韩精品午夜视频| 一本一本久久a久久精品综合麻豆| 欧美mv日韩mv国产|