MuleSoft · HTTP Connector
HTTP:UNSUPPORTED_MEDIA_TYPE
Short answer
HTTP:UNSUPPORTED_MEDIA_TYPE means the server does not support the media format of the data the HTTP Request operation sent (HTTP 415). Send the body in a format the server accepts and set the matching Content-Type.
VerifiedLast verified
01Error text
Error type: HTTP:UNSUPPORTED_MEDIA_TYPE02Likely causes
- The server does not support the media format of the requested data.
- By default, HTTP Connector raises an error for any response with a status code of 400 or above.
03How to fix it
- Turn on HTTP wire logging to see the exact request and response: in
log4j2.xml, enable the loggerorg.mule.service.http.impl.service.HttpMessageLoggeratDEBUGlevel. Check theContent-Typeheader and the body that were sent. - Produce the body in a format the server supports, and make sure its MIME type matches, for example by setting the output of the transformation that builds the body.
- Handle the failure with an error handler of type
HTTP:UNSUPPORTED_MEDIA_TYPE.
04Official documentation
→Related errors
- HTTP:NOT_ACCEPTABLEHTTP:NOT_ACCEPTABLE means the server cannot produce a response that matches the content negotiation headers of the request (HTTP 406). Correct the Accept headers the HTTP Request operation sends.
- HTTP:BAD_REQUESTHTTP:BAD_REQUEST means the server could not understand the request the HTTP Request operation sent because its syntax was invalid (HTTP 400). Log the outgoing request, compare it with what the server expects, and correct the body, headers or parameters.
- APIKIT:UNSUPPORTED_MEDIA_TYPEAPIKIT:UNSUPPORTED_MEDIA_TYPE is the APIkit for REST error type that maps to HTTP status 415 with the response message "Unsupported media type". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer