|
发表于 2004-6-4 17:21:35
|
显示全部楼层
python 的方法:
#! /usr/bin/env python
import httplib
import base64
ps=base64.encodestring('username:password')
ps='Basic '+ps
conn=httplib.HTTPConnection('www.3322.org')
conn.putrequest('GET','/dyndns/update?system=dyndns&hostname=yourname.3322.org')
conn.putheader('Authorization',ps)
conn.putheader('Host','www.3322.org')
conn.putheader('Accept','*/*')
conn.putheader('User-Agent','Mozilla/4.0 (compatible; MSIE 5.00; Windows 98')
conn.putheader('Connection','Keep-Alive')
conn.endheaders()
result=conn.getresponse()
print result.read()
conn.close() |
|