是否保证$ _SERVER ['REQUEST_METHOD']为大写? [英] Is $_SERVER['REQUEST_METHOD'] guaranteed to be uppercase?
本文介绍了是否保证$ _SERVER ['REQUEST_METHOD']为大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我当前在代码中输入了strtoupper($_SERVER['REQUEST_METHOD'])
.
I've currently got strtoupper($_SERVER['REQUEST_METHOD'])
in my code.
但是strtoupper
调用是否必要?可以保证$_SERVER['REQUEST_METHOD']
已经是大写吗?
But is the strtoupper
call necessary? Is $_SERVER['REQUEST_METHOD']
guaranteed to be uppercase already?
推荐答案
RFC 3875 定义REQUEST_METHOD
变量为大写,因此可以依靠它.
RFC 3875 defines the REQUEST_METHOD
variable as upper case, so it's okay to rely on it.
必须将REQUEST_METHOD元变量设置为以下方法 脚本应使用它来处理请求...
The REQUEST_METHOD meta-variable MUST be set to the method which should be used by the script to process the request ...
REQUEST_METHOD = method
method = "GET" | "POST" | "HEAD" | extension-method
extension-method = "PUT" | "DELETE" | token
该方法区分大小写.
这篇关于是否保证$ _SERVER ['REQUEST_METHOD']为大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文