我用jquery的AJAX通过POST过来数据 appliction/json-rpc 接收不到,这是为什么??
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script>
$.ajax({
type: 'POST',
url: "http://localhost/bubblewitch/index.php/rpc/ClientApi",
data: JSON.stringify("[{2:2},{1:1}]"),
success: function(){},
dataType: "text",
contentType: "application/json-rpc",
timeout:60000,
error: function(){}
});
</script>
$s = fopen("php://input", 'rb');
echo fread($s, 10000);
<br><font color="#e78608">------解决方案--------------------</font><br>当然有:<br><br>$s = file_get_contents('php://input');<br><br>$s 就是传入的参数<br><br><font color="#e78608">------解决方案--------------------</font><br>因为传输协议不合适 <div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号