<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Urllib - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/urllib/</link><description>Urllib - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Wed, 15 Jan 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/urllib/" rel="self" type="application/rss+xml"/><item><title>Python HTTP 客户端库</title><link>https://rd163.visword.com/posts/python-http-client-libs/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-http-client-libs/</guid><description><![CDATA[<h2 id="urlliburllib2" class="headerLink">
    <a href="#urlliburllib2" class="header-mark"></a>urllib、urllib2</h2><p>Python 2 时代常用的标准库 HTTP 客户端是 <code>urllib</code> 和 <code>urllib2</code>,它们提供了 URL 编码、请求构造、认证、重定向等基础能力，让我们能在不依赖第三方库的情况下完成大多数 HTTP 调用。两者的分工略有差异:<code>urllib</code> 偏向基础 URL 处理,<code>urllib2</code> 则在请求定制（如自定义 header、handler、opener）上更强大。</p>]]></description></item></channel></rss>