MuleSoft · HTTP Connector
HTTP:METHOD_NOT_ALLOWED
Short answer
HTTP:METHOD_NOT_ALLOWED means the server does not support the request method for the target resource (HTTP 405). Change the method on the HTTP Request operation to one the resource accepts.
VerifiedLast verified
01Error text
Error type: HTTP:METHOD_NOT_ALLOWED02Likely causes
- The server request method is not supported by the target resource.
- By default, HTTP Connector raises an error for any response with a status code of 400 or above.
03How to fix it
- Check which methods the target API allows for this resource.
- Set the Method on the HTTP Request operation to an allowed one, and check that the path points at the resource you intended.
- Turn on HTTP wire logging to see the exact request and response: in
log4j2.xml, enable the loggerorg.mule.service.http.impl.service.HttpMessageLoggeratDEBUGlevel. - Handle the failure with an error handler of type
HTTP:METHOD_NOT_ALLOWED.
04Official documentation
→Related errors
- HTTP:NOT_FOUNDHTTP:NOT_FOUND means the HTTP Request operation received a 404 response because the server could not find the requested resource. Check the URL shown in the error description, then correct the request or handle the error type in an error handler.
- 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:METHOD_NOT_ALLOWEDAPIKIT:METHOD_NOT_ALLOWED is the APIkit for REST error type that maps to HTTP status 405 with the response message "Method not allowed". 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