import requests
json_data = {'data':'fraise'}
requests.post(url='***********************', json=json_data)
<?php
$post_data = json_decode(file_get_contents('php://input'), true); //Recevoir JSON
$data = $post_data["data"];
define("TESTFILE","./all_data.txt");//Ecrire la valeur reçue dans un fichier txt
$fh = fopen(TESTFILE, "w");
fwrite($fh,$data);
fclose($fh);
?>
data = requests.get('***********************/all_data.txt')
print(data.text)
Recommended Posts