发布网友 发布时间:2022-04-24 17:41
共2个回答
热心网友 时间:2022-04-24 02:15
import urllib,urllib2
url='http://192.168.199.1:8000/mainsugar/loginGET/'
textmod ={'user':'admin','password':'admin'}
textmod = urllib.urlencode(textmod)
print(textmod)
#输出内容:password=admin&user=admin
req = urllib2.Request(url = '%s%s%s' % (url,'?',textmod))
res = urllib2.urlopen(req)
res = res.read()
print(res)
#输出内容:登录成功
热心网友 时间:2022-04-24 03:33
import requests
requests.get(url)