@Test public void test(){ NVPair[] files = [ // new NVPair("imageBestFile", FileToParam.getTargetFile("./src/main/resources/imageBestFile.jpg")), new NVPair("file", "./src/main/resources/imageEnvFile.jpg") ] //headers = [new NVPair("", "")] byte[] data = Codecs.mpFormDataEncode(params, files, headers); HTTPResponse result = request.POST("http://10.101.22.215:8080/webapi/material/base/file/upload",data) String str=result.getText() String str1 = "\"retcode\":0"; boolean status = str.contains(str1) && result.statusCode==200 if(status){ grinder.logger.info("[事务成功]:code:="+result.getStatusCode()+"; getMsg="+str) Assert.assertTrue(true) }else{ grinder.logger.info("[事务失败]:code:="+result.getStatusCode()+"; getMsg="+str) Assert.fail() } }