I'm trying to post several files, the API endpoint accept a file and json File, but I Receive a 415 Response Code
@Test(enabled = true)
public void testResp(){
RestAssured.given()
.baseUri("http://localhost")
.port(8082)
.basePath("/documents/")
.header(new Header("content-type", "multipart+/form-data"))
.multiPart(new MultiPartSpecBuilder(directoryFiles)
.fileName("file.txt")
.controlName("file")
.mimeType("text/plain")
.build())
.multiPart(new MultiPartSpecBuilder(directoryFiles)
.fileName("metadata-txt.json")
.controlName("metadata")
.mimeType("application/json")
.build())
.when()
.post("documents/")
.then()
.log()
.all();
}
Log
HTTP/1.1 405 Allow: GET Content-Type: application/json Transfer-Encoding: chunked Date: Fri, 31 Jul 2020 16:11:55 GMT Keep-Alive: timeout=60 Connection: keep-alive
{ "timestamp": "2020-07-31T16:11:55.657+00:00", "status": 405, "error": "Method Not Allowed", "message": "", "path": "/docmgmt/documents/documents/" }
Now I have a Different Error,