目录
1.接口数据获取
1)打开F12或者使用抓包工具获取接口数据
2)Request Method:POST
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryk4XHZa6brexVYeAs
2.新建Http Request并填写基础数据
1)填写 Web Server:protocol,ip,port
2)填写 Http Request:Method,Path,endcoding
3)填写 Parameters
4)勾选Follow Redirects、Use KeepAlive、Use multipart/form-data
3.导入文件路径设置
4.Content-Type处理
如果HTTP Header Manager已设置全局Content-Type,并且与当前导出接口类型不一致,则需要添加BeanShell PreProcessor,移除全局Content-Type
sampler.getHeaderManager().removeHeaderNamed("Content-Type");