-1
  • File details are provided in file upload configuration and use multipart/from data for Post is checked though unable to upload file in jmeter for API -as the UI is not available for webservice I am unable to judge name parameter value in file configuration, can someone please help to proceed upload scenario without providing Parameter name in jMeter.

I tried to perform File uplaod through jmeter using POST menthod, and getting server side error as below:

Web Service Error javax.ws.rs.ClientErrorException: HTTP 415 Unsupported Media Type at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117) ~[cxf-rt-frontend-jaxrs-3.0.1.jar:3.0.1] at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:157) ~[cxf-rt-frontend-jaxrs-3.0.1.jar:3.0.1] at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:526) ~[cxf-rt-frontend-jaxrs-3.0.1.jar:3.0.1] at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177) ~[cxf-rt-frontend-jaxrs-3.0.1.jar:3.0.1] at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77) ~[cxf-rt-frontend-jaxrs-3.0.1.jar:3.0.1] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) [cxf-core-3.0.1.jar:3.0.1] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.0.1.jar:3.0.1]

Kishor B
  • 45
  • 2
  • 10
  • **Gone through the solution provided on** https://stackoverflow.com/questions/22566433/http-415-unsupported-media-type-error-with-json ---- but jMeter sending "content type : MIME type" mentioned in file upload configuration – Kishor B Jul 25 '18 at 06:15

1 Answers1

0

HTTP Status Code 415 means that the server doesn't recognise or accept the Content-Type header you're sending.

Add a HTTP Header Manager as a child of the relevant HTTP Request sampler and configure it to send the relevant Content-Type header which would be application/json for REST API or application/soap+xml for SOAP

Dmitri T
  • 159,985
  • 5
  • 83
  • 133