In this method below I was making an API call to a locally running API that accepts only one file as a request, but is there any possible way to make an API call that accepts multiple files as request using Rest Assured dynamically at run time based on requests for that API? like how to add multiple files as an API request in Rest Assured at run time dynamically?
public String restTest() {
String resp = RestAssured.given().multiPart("file", new File("C:/Local/file/path/LocalFiles/file.txt")).when().post("http://localhost:4444/local/upload").then().assertThat().statusCode(200).and().extract().body().asString();
return resp.toString();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…