问题遇到的现象和发生背景
Python做接口测试,运行成功了,但是打印的结果里面是空的
问题相关代码,请勿粘贴截图
import unittest,requests
class ABC_001_asdsa(unittest.TestCase):
def setUp(self):
self.url="http://ws.webxml.com.cn/WebServices/WeatherWebService.asmx/getSupportCity"
def tearDown(self):
pass
def test_001_abc(self):
# parameters={"byProvinceName":"广东"}
# res=requests.get(url=self.url,json=parameters)
res=requests.get(url=self.url,params="byProvinceName=广东")
print(res.json)
运行结果及报错内容
C:\Program Files (x86)\JetBrains\PyCharm 5.0.3\helpers\pycharm\utrunner.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
<bound method Response.json of <Response [200]>>
进程已结束,退出代码0
我想要达到的结果
应该是可以打印出返回的数据