import requests
import json
url = "http://your-domain/third_api/update/code"
data = {
"key": "your_real_key",
"dept_list": [
{
"dept_code": "001",
"dept_name": "更新后的部门名称 1"
},
{
"dept_code": "002",
"dept_name": "新的部门名称 2"
}
]
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, data=json.dumps(data), headers=headers)
print(response.json())