摘要:print (response.json()['data']['patientId'])TypeError: list indices must be integers or slices, not str 原因:{...'data':[{'patientId':''}] } 解决方法: print
阅读全文
偶然路过的靓仔-胡阳为中华之崛起而读书!中国加油! 问题不能及时回答,有需要的话加微信:921308494 |
:: :: :: :: :: 管理 |
|
|
随笔分类 - python+requests
转载请注明出处!联系本人:wx921308494
摘要:print (response.json()['data']['patientId'])TypeError: list indices must be integers or slices, not str 原因:{...'data':[{'patientId':''}] } 解决方法: print
阅读全文
摘要:用pip install sudo是不行的。去官网下载下来,安装。然后pycharm里面install一下 导包: import suds.clientfrom suds.sax.text import Raw准备webservice连接: webserviceUrl='****:****/eif-
阅读全文
摘要:导包: import requestsimport re 准备 url、head, baseUrl = 'http://******:****'head = {'Content-Type': 'text/x-gwt-rpc; charset=UTF-8', 'Cookie': 'JSESSION_I
阅读全文
摘要:接口返回: r = requests.post(url=self.url, data=params,headers=self.head)print(r.text)assert 'OK' in r.text'''根据左右边界提取,(.*?)是正则表达式,如同jmeter一样,a在b里面找'''impo
阅读全文
摘要:接口项目命名:PyInterface 目录内容: interfaces里面放接口用例 reports里面放产出报告 base.py文件用于通用的域名等 run.py 文件项目入口,用例集合 用例编写:
阅读全文
摘要:怎么区别是字典还是json的字符串格式: -- json中可以存在有null -- python的字典中只存在none 输出一下格式print(type(...)) import json 把 json格式转成字典: json.loads() 把字典转成json格式: json.dumps()
阅读全文
摘要:get、post是我们常见的接口方式 区别: 安全性:post比get安全 请求参数:get的参数放在url里面(仅支持urlencode编码),post的参数是放在body(支持多种编码) 请求参数长度限制:get请求长度最多1024kb,post对请求数据没有限制 返回的常见状态码: 200成功
阅读全文
摘要:以管理员身份运行cmd 然后再执行pip的更新命令或者其他命令
阅读全文
摘要:①安装requests 在cmd中,pip install requests ②pycharm中导入 file-->setting-->添加 ③ ④编码如下: #coding=utf-8 import requests import json base_url='*******' url=base_
阅读全文
|