code in processor:

Response response = RestAssured.given().header("Content-Type", "application/x-www-form-urlencoded")
                    .formParam("request", request1).request().post(url);

url mentioned here is external email outbound service in Apache ServiceMix I'm using just simple maven project to invoke ServiceMix email service

The above code working fine. But I need to send attachment with the above POST request. So I add one more functionality like as:

Response response = RestAssured.given().header("Content-Type", "application/x-www-form-urlencoded")
                    .formParam("request", request1).multiPart(fileName , fileName + "bin",
attachment).request().post(url);

It shows some error like below:

java.lang.IllegalArgumentException: Content-Type application/x-www-form-urlencoded is not valid when using multiparts, it must start with "multipart/".
0

There are 0 best solutions below