我一直在努力从我的API服务器启用PUT
和DELETE
请求。我检查了/etc/apache2/mods-available/userdir.conf
文件,它看起来如下:
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Require all granted
</Limit>
<LimitExcept GET POST OPTIONS>
Require all denied
</LimitExcept>
</Directory>
</IfModule>
我在PUT
和DELETE
块中的OPTIONS
之后添加了limit
和limitExcept
,然后重新启动了apache服务器。尽管如此,我的PUT
/ DELETE
来电仍然向我发出以下错误:
Method not allowed
Method not allowed. Must be one of: GET, POST
非常感谢任何帮助。谢谢!