码迷,mamicode.com
首页 > 编程语言 > 详细

python get请求

时间:2018-04-26 21:08:17      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:usr   inf   info   request   iges   text   enc   def   digest   

#!/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请求

标签:usr   inf   info   request   iges   text   enc   def   digest   

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

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!