MuleSoft · HTTP Connector
HTTP:NOT_ACCEPTABLE
Short answer
HTTP: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.
VerifiedLast verified
01Error text
Error type: HTTP:NOT_ACCEPTABLE02Likely causes
- The server cannot produce a response matching the list of acceptable values defined in the request's content negotiation headers.
- 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. Look at theAcceptheaders in the outgoing request. - Set the
Acceptheader on the HTTP Request operation to a media type the server can return. - Handle the failure with an error handler of type
HTTP:NOT_ACCEPTABLE.
04Official documentation
→Related errors
- HTTP:UNSUPPORTED_MEDIA_TYPEHTTP: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.
- 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:NOT_ACCEPTABLEAPIKIT:NOT_ACCEPTABLE is the APIkit for REST error type that maps to HTTP status 406 with the response message "Not acceptable". 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