首页 > 编程语言 > 详细

python get请求

时间:2018-04-26 20:21:12      阅读:196      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/python
#-*- coding:UTF-8 -*-
#coding=utf-8
import requests import time import hashlib import sys def getUser(userId): aid = 0 t = time.time() aTime = int(round(t * 1000)) hl = hashlib.md5() tmp = str(aid) + "369abc123" + str(aTime) hl.update(tmp.encode(encoding=utf-8)) key = hl.hexdigest() url = http://10.10.10.10:8080/api/user/getUserInfo resp = requests.get(url, params={aid: aid, aTime: aTime, key: key, userId: userId}) print resp.text if __name__ == __main__: getUser(sys.argv[1])

 

python get请求

原文:https://www.cnblogs.com/drizzlewithwind/p/8954692.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!