How do I stop Apache httpd from rejecting HTTP PATCH requests?

筅森魡賤 提交于 2019-12-02 06:02:34

问题


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).



来源:https://stackoverflow.com/questions/13994833/how-do-i-stop-apache-httpd-from-rejecting-http-patch-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!