【发布时间】:2021-06-02 16:33:08
【问题描述】:
在我的烧瓶项目中,我有一条路线:
@app.route('/api/d/u', methods=['POST'])
def update(name, domain_list, pem_key, pem_cert, origin_ips): # name, domain_list, pem_key, pem_cert, origin_ips
return "update"
if __name__ == '__main__':
app.run(debug=True)
但在我的邮递员中我想测试 api,
当我发送请求但得到 TypeError 时:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>TypeError: update() missing 5 required positional arguments: 'name', 'domain_list', 'pem_key', 'pem_cert', and 'origin_ips' // Werkzeug Debugger</title>
<link rel="stylesheet" href="?__debugger__=yes&cmd=resource&f=style.css"
type="text/css">
<!-- We need to make sure this has a favicon so that the debugger does
not by accident trigger a request to /favicon.ico which might
change the application state. -->
......
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
TypeError: update() missing 5 required positional arguments: 'name', 'domain_list', 'pem_key', 'pem_cert', and 'origin_ips'
-->
【问题讨论】: