如何在 python 中的 URL 上发送 JSON 文件?
How to send a JSON file on an URL in python?
我有一个 JSON:
url = 'https://your_php_server_url.com/php_endpoint'
payload = {
'full_name': the_name,
'phone_number': the_phone,
}
如何在 python 中使用 POST 发送 json?
Python端,可以使用requests库:
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)
我有一个 JSON:
url = 'https://your_php_server_url.com/php_endpoint'
payload = {
'full_name': the_name,
'phone_number': the_phone,
}
如何在 python 中使用 POST 发送 json?
Python端,可以使用requests库:
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)