![在 Apache HTTP Server 中启用对 HTTP 方法的支持](https://linux22.com/image/698889/%E5%9C%A8%20Apache%20HTTP%20Server%20%E4%B8%AD%E5%90%AF%E7%94%A8%E5%AF%B9%20HTTP%20%E6%96%B9%E6%B3%95%E7%9A%84%E6%94%AF%E6%8C%81.png)
我正在使用 curl 发送 PUT 请求并收到 405 方法不允许状态代码。我注释掉了文件<Limit>
中的指令httpd.conf
,但仍然看到此错误。
我发送的 CURL 请求
curl -w "OFB:return-code=%{http_code}:time-total=%{time_total}::OFE" -g -v \
--cert /tmp/2k.pem --key /tmp/2k.key --limit-rate 0 -o output.gz \
-H 'Accept-Encoding: gzip' -X PUT http://[2010::102]/sw_compression/ht.html
收到回复
> PUT /sw_compression/ht.html HTTP/1.1
> User-Agent: curl/7.35.0
> Host: [2010::102]
> Accept: */*
> Accept-Encoding: gzip
>
< HTTP/1.1 405 Method Not Allowed
< Date: Thu, 16 Feb 2017 09:03:09 GMT
* Server Apache/2.2.22 (Fedora) is not blacklisted
< Server: Apache/2.2.22 (Fedora)
< Allow: GET,HEAD,POST,OPTIONS,TRACE
< Content-Length: 400
< Content-Type: text/html; charset=iso-8859-1
<
{ [data not shown]
100 400 100 400 0 0 39062 0 --:--:-- --:--:-- --:--:-- 44444