以下是代码示例:
我收到了以下错误信息。
有什么想法吗?
theurl = "https://%s:%s@members.dyndns.org/nic/update?hostname=%s&myip=%s&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG" % (username, password, hostname, theip)
conn = urlopen(theurl) # send the request to the url
print(conn.read()) # read the response
conn.close() # close the connection
我收到了以下错误信息。
File "c:\Python31\lib\http\client.py", line 667, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
有什么想法吗?
/
字符,所以添加safe=''
对我有用,谢谢 :) - Ian Clark