ABOUT
Danny Man
I’m Danny, and let me give you a warm welcome to visit my blog site. I hope you’ll enjoy it. Also, you can visit my HOME PAGE to learn more about me.
SEARCH
用Python搞定基本认证
本文翻译自《Basic Authentication》,翻译得不好还请见凉。引言这篇教程意在阐明什么是基本认证(base authentication)以及如何用python对其进行处理。你可以从Voidspace Python Recipebook下载本文中的示例代码。第一个示例,So Let's Do It,展示了如何手动处理基本认证,以此解释其工作原理。第二个示例,Doing it Properly,则采用一种更合适更自动化的方法来处理。示例中利用了Python标准库中的urllib2模块,它提供了一个简单的接口用于从互联网请求页面。其中的urlopen方法以openers...