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

MuleSoft error
Error type: HTTP:UNSUPPORTED_MEDIA_TYPE

02Likely 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

  1. Turn on HTTP wire logging to see the exact request and response: in log4j2.xml, enable the logger org.mule.service.http.impl.service.HttpMessageLogger at DEBUG level. Check the Content-Type header and the body that were sent.
  2. 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.
  3. Handle the failure with an error handler of type HTTP:UNSUPPORTED_MEDIA_TYPE.

04Official documentation

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

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.