问题:
I've seen a couple questions around here like How to debug RESTful services , which mentions: 我在这里看到了几个问题,例如如何调试RESTful服务 ,其中提到:
Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST. 不幸的是,同一浏览器不允许我测试HTTP PUT,DELETE,并且在某种程度上甚至无法测试HTTP POST。
I've also heard that browsers support only GET and POST, from some other sources like: 我还听说其他一些来源的浏览器仅支持GET和POST:
- http://www.packetizer.com/ws/rest.html http://www.packetizer.com/ws/rest.html
- http://www.mail-archive.com/jmeter-user@jakarta.apache.org/msg13518.html http://www.mail-archive.com/jmeter-user@jakarta.apache.org/msg13518.html
- http://www.xml.com/cs/user/view/cs_msg/1098 http://www.xml.com/cs/user/view/cs_msg/1098
However, a few quick tests in Firefox show that sending PUT
and DELETE
requests works as expected -- the XMLHttpRequest
completes successfully, and the request shows up in the server logs with the right method. 但是,在Firefox中进行的一些快速测试表明,发送PUT
和DELETE
请求可以按预期方式工作XMLHttpRequest
成功完成,并且该请求以正确的方法显示在服务器日志中。 Is there some aspect to this I'm missing, such as cross-browser compatibility or non-obvious limitations? 我是否缺少某些方面的信息,例如跨浏览器兼容性或非显而易见的限制?
解决方案:
参考一: https://stackoom.com/question/h7r/大多数Web浏览器中都可以使用PUT-DELETE-HEAD等方法吗参考二: https://oldbug.net/q/h7r/Are-the-PUT-DELETE-HEAD-etc-methods-available-in-most-web-browsers
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4397142