0
我有一個職位的API調用,它允許我在表單數據參數名爲「文件」 上傳多個圖像我可以發送多個文件的表單數據有關鍵「文件」和值作爲多個文件多文件上傳與休息放心
我想模擬與休養生息的Java客戶端相同的調用。我可以上傳單個文件,但不能上傳多個文件。
以下爲單文件上傳休息,保證代碼:
File sheetFile = new File(sheetPath.get(0)); response = RestAssured. given(). headers(headers). formParameter("studentDetail", "{"+ "\"userId\" : "+PropFileHandler.readProperty("psUserId")+ ",\"institutionId\" : "+PropFileHandler.readProperty("institution_id")+ ",\"externalUserId\" : "+PropFileHandler.readProperty("user_id")+ ",\"tokenId\" : \"12000\""+ ",\"imagePathStatus\" : \"\""+ "}"). formParameter("clientType", getData("ps_bulk_upload_image.clientType")). multiPart("file", sheetFile). #here i want to upload multile files when(). post(relativePath). then(). statusCode(200). body(matchesJsonSchema(new File(test.cngActions.getJsonSchemaDirectoryPath()+ getData("ps_bulk_upload_image.schemaPath")))). extract().response();
任何幫助,將不勝感激。