python代码
import json
import requests
temp_dict = {"user_id":"zed","user_password":"zed123","degrees":"23.5"}
r=requests.post('https://localhost:8080/php/test.php',json = temp_dict)
print(r.status_code)
字符串
php代码
<?php
echo json_decode(file_Get_contents("php://input"))->{'user_id'};
?>
型
我想把Python发送的字典的键和值以echo的形式导出,但是我不知道怎么做。
运行.py文件后的status_code结果:200运行.py文件后的文本结果:空值
1条答案
按热度按时间6jygbczu1#
字符串