服务器禁用了请求中指定的方法
python post请求时报错
服务器禁用了请求中指定的方法
错误代码
response = requests.post(f'http://api.fe.udream.cc/api/UserEngineering/UpdateTask?usertoken=132e5a6e12a6bbff88154b27b0241819×tamp={timestamp}', json=json.dumps(datas),headers={'Content-Type':'application/json'})
正确代码:
import time
import requests
import json
json_path='00_21_43_8.json'
with open(json_path, 'r') as file:
datas = json.load(file)
timestamp = int(time.time())
data = {
"type": "1",
"msg":"ok",
"data":datas,
"usertoken":"132e5a6e12a6bbff88154b27b0241819",
"timestamp":timestamp
}
# datas["usertoken"]="132e5a6e12a6bbff88154b27b0241819"
# response = requests.post(f