基本上就像标题所说的那样,当使用 JavaScript 发出 AJAX 请求时。该方法(即 GET/POST)是否需要大写?提前致谢。
编辑:即使是或否就足够了。
最佳答案
您可以在 http://www.w3.org/TR/XMLHttpRequest/#the-open-method 阅读相关信息
我引用
When the open(method, url, async, user, password) method is invoked, the user agent must run these steps (unless otherwise indicated):
..
3. If method is a case-insensitive match for CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE, or TRACK subtract 0x20 from each byte in the range 0x61 (ASCII a) to 0x7A (ASCII z).
..
这意味着它会自己自动将其转换为大写..
所以它似乎有一些意义(更喜欢大写),我建议你使用大写来避免实现缺陷(不可能)。
关于javascript - AJAX 中的方法参数是否需要大写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4046690/