2019独角兽企业重金招聘Python工程师标准>>>
import hashlib,requests
def wangsu_cdn_flush(user,password,purge):
Headers = {"Content-Type": "application/x-www-form-urlencoded",
"Connection": "Keep-Alive"}
sign = hashlib.md5(user+password+purge).hexdigest()
Data = "username=%s&passwd=%s&url=%s" %(user,sign,purge)
response = requests.post('http://wscp.lxdns.com:8080/wsCP/servlet/contReceiver?',data=Data,headers=Headers)
return response.text
if __name__ == "__main__":
PURGE = 'http://xxx/static/images/Vnew/i4.jpg; http://xxx/static/images/Vnew/gsl_001.png;'
user='xxxx'
password='xxx'
wangsu_flush(user,password,PURGE)
执行返回:
success append purge tasks... 刷新成功
转载于:https://my.oschina.net/u/142602/blog/744207
最后
以上就是义气树叶最近收集整理的关于网宿cdn api 刷新缓存函数的全部内容,更多相关网宿cdn内容请搜索靠谱客的其他文章。
发表评论 取消回复