當我嘗試background為我的 Flask 應用程式回傳第二個引數時,我得到一個空值,但它適用于original
> curl http://127.0.0.1:5000?original="sdsd" & background="/szzzzzz"
@app.route('/',methods=['GET'])
def API():
if request.method == 'GET':
original = request.args.get('original')
background = request.args.get('background')
result = background
return jsonify(result)
uj5u.com熱心網友回復:
很可能您的 shell 忽略了后面的部分,&因為該字符正在向 shell 發出信號,要求在后臺運行命令的第一部分。
嘗試像這樣運行 curl 命令:
curl "http://127.0.0.1:5000?original=sdsd&background=/szzzzzz"
引號將轉義&字符,以便將整個字串傳遞給 curl。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/427232.html
上一篇:管道無法通過sed卷曲
