I would like to interact with a website written in PHP using Python. It pulls its data from a form with method `POST`. Now I have tried to set the values in `$_POST` by doing:
url = 'https://www.example.com/myscript.php'
data = {"PcID":"AJFJ-01AR","email":"email","refc":"","startBtn":"Start"}
result = requests.post(url, json=data).content
But I am sadly unable to set the values PHP receives with this (I am returned the page with form instead of after, meaning not all values are set). The data
variable is copy-pasted from what PHP receives using the form on the website (echo json_encode($_POST);
). Am I generally wrong in what I am doing? It wouldn't be hard for me to just give the values with a regular GET
request but I am still wondering why this would not work.
Thank you!