python http基本验证方法
如下所示: #!usr/bin/env python # -*- coding: utf-8 -*- import urllib2 LOGIN = "" PASSWORD = "" URL = "" REALM = "Secure Archive" def handler_version(url): from urlparse import urlparse#urlparse用来将url拆成各个部分scheme netloc path params query fragment hdlr = urllib2.HTTPBasicAuthHandler()#http验证类 里面有用户名和密码
用户评论