How do I stop Apache httpd from rejecting HTTP PAT

2019-02-26 01:39发布

问题:

I'm working on an implementation of the JSON Patch spec using Java servlets on the Bitnami Tomcat Stack. On the servlet end I'm handling the HTTP PATCH method by overriding HttpServlet.service() method like so:

@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
    if (request.getMethod().equals("PATCH"))
        doPatch(request, response);
    else
        super.service(request, response);
}

The problem is that, when I try to send an HTTP PATCH request to Tomcat, Apache httpd rejects it with a 501 "Method Not Implemented".

Is there a way to make Apache httpd stop doing this?

回答1:

AJP13 does not yet support HTTP PATCH (AJPv13a). Connect your Apache Web Server and Tomcat using HTTP if you would like to use PATCH.



回答2:

HTTP method PATCH is not implemented in Tomcat (as per current version 7.0.39).