我正在尝试使用curl和
python烧瓶将文件上传到服务器.下面我有如何实现它的代码.关于我做错什么的任何想法.
curl -i -X PUT -F name=Test -F filedata=@SomeFile.pdf "http://localhost:5000/" @app.route("/",methods=['POST','PUT']) def hello(): file = request.files['Test'] if file and allowed_file(file.filename): filename=secure_filename(file.filename) print filename return "Success"
以下是服务器发回的错误
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>400 Bad Request</title> <h1>Bad Request</h1> <p>The browser (or proxy) sent a request that this server Could not understand.</p>
提前致谢.
解决方法
原文地址:https://www.jb51.cc/linux/393899.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。