开发者

Does the method argument in AJAX need to be upper case?

开发者_运维知识库

Well basically what the title says, when making an AJAX request with JavaScript. Does the method, i.e. GET / POST, need to be upper case? Thanks in advance.

Edit: Even a yes or no will suffice.


You can read about it at http://www.w3.org/TR/XMLHttpRequest/#the-open-method

I quote

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).
..

which means it will automatically convert it to upper case on its own ..

So it seems to have some significance (preferring uppercase), and i would suggest you use uppercase just to avoid implementation flaws (improbable).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜