import requests
json_data = {'data':'Erdbeere'}
requests.post(url='***********************', json=json_data)
<?php
$post_data = json_decode(file_get_contents('php://input'), true); //Erhalte JSON
$data = $post_data["data"];
define("TESTFILE","./all_data.txt");//Schreiben Sie den empfangenen Wert in eine txt-Datei
$fh = fopen(TESTFILE, "w");
fwrite($fh,$data);
fclose($fh);
?>
data = requests.get('***********************/all_data.txt')
print(data.text)
Recommended Posts