比如访问一个网址 http://localhost/api/
对应的目录和文件应为 E:\www\api\index.php
,因为apache
设置了DirectoryIndex index.php
,默认访问index.php。
通过get请求这个网址 $_SERVER['REQUEST_METHOD']
为get,
但是通过post请求这个网址 $_SERVER['REQUEST_METHOD']
还是为get而且得不到传输的值,
最后修改如下网址http://localhost/api/index.php
,post请求才得以访问,请教一下这个是什么原因呢?
你是通过是什么方式提交的,我试了一下没问题的哈!