⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.encoding

📁 harvest是一个下载html网页得机器人
💻 ENCODING
字号:
		    Content Encoding Support for libcurl* About content encodings: HTTP/1.1 [RFC 2616] specifies that a client may request that a server encodeits response. This is usually used to compress a response using one of a setof commonly available compression techniques. These schemes are `deflate' (thezlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client requeststhat the sever perform an encoding by including an Accept-Encoding header inthe request document. The value of the header should be one of the recognizedtokens `deflate', ... (there's a way to register new schemes/tokens, see sec3.5 of the spec). A server MAY honor the client's encoding request. When aresponse is encoded, the server includes a Content-Encoding header in theresponse. The value of the Content-Encoding header indicates which scheme wasused to encode the data.A client may tell a server that it can understand several different encodingschemes. In this case the server may choose any one of those and use it toencode the response (indicating which one using the Content-Encoding header).It's also possible for a client to attach priorities to different schemes sothat the server knows which it prefers. See sec 14.3 of RFC 2616 for moreinformation on the Accept-Encoding header.* Current support for content encoding:Support for the 'deflate' and 'gzip' content encoding are supported bylibcurl. Both regular and chunked transfers should work fine.  The libraryzlib is required for this feature. 'deflate' support was added by JamesGallagher, and support for the 'gzip' encoding was added by Dan Fandrich.* The libcurl interface:To cause libcurl to request a content encoding use:     curl_easy_setopt(curl, CURLOPT_ENCODING, <string>) where <string> is the intended value of the Accept-Encoding header.Currently, libcurl only understands how to process responses that use the"deflate" or "gzip" Content-Encoding, so the only values for CURLOPT_ENCODINGthat will work (besides "identity," which does nothing) are "deflate" and"gzip" If a response is encoded using the "compress" or methods, libcurl willreturn an error indicating that the response could not be decoded.  If<string> is NULL no Accept-Encoding header is generated.  If <string> is azero-length string, then an Accept-Encoding header containing all supportedencodings will be generated.The CURLOPT_ENCODING must be set to any non-NULL value for content to beautomatically decoded.  If it is not set and the server still sends encodedcontent (despite not having been asked), the data is returned in its raw formand the Content-Encoding type is not checked.* The curl interface:Use the --compressed option with curl to cause it to ask servers to compressresponses using deflate.James Gallagher <jgallagher@gso.uri.edu>Dan Fandrich <dan@coneharvesters.com>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -