Issue
I have a JSON:
url = 'https://your_php_server_url.com/php_endpoint'
payload = {
'full_name': the_name,
'phone_number': the_phone,
}
How can I send the json using POST in python?
Solution
Python side, you can use requests library:
import requests
url = 'https://your_php_server_url.com/php_endpoint'
payload = {
'full_name': the_name,
'phone_number': the_phone,
}
r = requests.post(url, json=payload)
print(r.text)
Answered By - AleG
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.