I started using RESTAssured recently and am making a REST call using the RESTAssured library.
I have an attachment in the request which I am attaching using the "multipart()" method. For my API I should be passing "application/x-abc-xyz+xml" as the Content-Type.
When I tried setting this using " contentType()" I get below error, however preceding the content-type with "multipart/" will resolve this error but I am not getting the REST response from the server because it expects the content-type without the "multipart/" prefix.
I need help in resolving this issue.
java.lang.IllegalArgumentException: Content-Type application/x-hub-multipart+xml is not valid when using multiparts, it must start with "multipart/".
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at io.restassured.internal.RequestSpecificationImpl.registerRestAssuredEncoders