如何阻止 Apache httpd 拒绝 HTTP PATCH 请求? [英] How do I stop Apache httpd from rejecting HTTP PATCH requests?
问题描述
我正在实施 在 Bitnami Tomcat Stack 上使用 Java servlet 的 JSON Patch 规范.在 servlet 端,我通过像这样覆盖 HttpServlet.service() 方法来处理 HTTP PATCH 方法:
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);
}
问题在于,当我尝试向 Tomcat 发送 HTTP PATCH 请求时,Apache httpd 以 501未实现方法"拒绝它.
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".
有没有办法让 Apache httpd 停止这样做?
Is there a way to make Apache httpd stop doing this?
推荐答案
AJP13 尚不支持 HTTP PATCH (AJPv13a).如果您想使用 PATCH,请使用 HTTP 连接您的 Apache Web 服务器和 Tomcat.
AJP13 does not yet support HTTP PATCH (AJPv13a). Connect your Apache Web Server and Tomcat using HTTP if you would like to use PATCH.
这篇关于如何阻止 Apache httpd 拒绝 HTTP PATCH 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!