20171213-python自动化-接口测试-jmeter-post-up-load

接口6:上传文件

简要描述:联系上传文件

请求URL:http://api.nnzhp.cn/api/file/file_upload

1,打开jmeter,右键点击测试计划,选择添加-threads-线程组

2,点击线程组,右键添加sampler-http请求

3,http请求页面,服务器名称或IP栏位输入:api.nnzhp.cn;方法选择post;路径输入:/api/file/file_upload

4,http请求页面,点击files upload,文件名称输入:xxx(文件的绝对路径),参数名输入:file

4,点击线程组,右键添监听器-查看结果树,点击工具栏绿色小箭头执行脚本

5,点击查看结果树,查看请求url及响应数据

POST data:
--f7sj-BeXQz3sOFHy1Hxn1BN5XS6d98JIlxizwx
Content-Disposition: form-data; name="file"; filename="data.txt"
Content-Type:
Content-Transfer-Encoding: binary

<actual file content, not shown here>
--f7sj-BeXQz3sOFHy1Hxn1BN5XS6d98JIlxizwx--

 

{
"error_code": 1000,
"msg": "操作成功"
}

posted @ 2017-12-13 16:20  蓬莱大侠  阅读(454)  评论(0)    收藏  举报