【已完成】post任意内容请求到php,并返回同一个json
有没有大佬会的,搞定给红包接受post的任意内容
json内容123
已结帖,感谢iiss <?php header('Content-Type:application/json'); $json = 123; echo json_encode($json,JSON_UNESCAPED_UNICODE); ?> 这不就一行代码的事么
<?php echo "123" ?> 恭喜楼上一行代码拿红包 这是返回html,要json啊大佬 header(‘content-type:application/json’);
$number = array('1','2','3','4','5','6','7','8','9','0');
echo json_encode($number); 不太行,返回500 引号改成半角
content-type: 后面多个空格
<?php
header("content-type: application/json");
$number = array('1','2','3','4','5','6','7','8','9','0');
echo json_encode($number);
?> <?php header('Content-Type:application/json'); $json['data'] = '123'; echo json_encode($json,JSON_UNESCAPED_UNICODE); ?> iiss 发表于 2022-2-16 00:49
json内容变成了{"data":"123"}
只要123,大佬再改改? sdqu 发表于 2022-2-16 00:39
引号改成半角
content-type: 后面多个空格
["1","2","3","4","5","6","7","8","9","0"]
输出内容左右都多了括号,大佬再改改?
页:
[1]