服务端
@app.route('/user/<string:todo_name>', methods=['GET'])
def user(todo_name):
# 从请求头中获取 Token
headers = request.get_json()
print(headers)
canshu1= headers.get('canshu1')
canshu2= headers.get('canshu2')
print(api_token,user_id,todo_name)
return jsonify({'s':'ok'})
客户端
headers = {'canshu1': canshu1,
'canshu2': canshu2
}
print(headers)
response = requests.get(url, json=headers)