Here the server side code with python & flask:
from flask import Flask, request, send_fileimport ioimport zipfileimport bitstringapp = Flask(__name__)@app.route('/s/', methods=['POST'])def return_files_tut(): try: f = io.BytesIO() f.write("abcd".encode()) return send_file(f, attachment_filename='a.ret.zip') except Exception as e: return str(e)if __name__ == '__main__': app.run(debug=True)Bellowing is curl command:
λ curl -X POST http://localhost:5000/s/ -o ret.tmp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 4 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (18) transfer closed with 4 bytes remaining to readHow should I use curl to receive the file?