i need to send this file path /Users/bob/Documents/python_stuff/venv/json_output.json to the php page of http://localhost:8888/demo/display_data.php
My python code:
url = 'http://localhost:8888/demo/display_data.php'
file_path_json = {"1": "/Users/bob/Documents/python_stuff/venv/json_output.json"}
resp = requests.post(url, params=file_path_json)
php code:
$json_path['1'] = $_GET['1'];
I do not know why it is not working. I have installed the requests module.
I have tried following code on my PC and it's working for me
import requests
url = 'http://localhost/dx/index.php'
file_path_json = {"1": "/Users/bob/Documents/python_stuff/venv/json_output.json"}
resp = requests.post(url, file_path_json)
print(resp)
hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With