【发布时间】:2015-01-28 00:30:07
【问题描述】:
我正在尝试向使用 Flask 路由的 URL 发送两个参数。
如果我这样做:
curl -i http://127.0.0.1:5000/api/journeys/count?startStationName=Hansard%20Mews,%20Shepherds%20Bush&endStationName=Farringdon%20Lane,%20Clerkenwell
然后我的代码是:
@application.route('/api/journeys/count', methods=['GET'])
def journeys():
print request.args
startStationName = request.args.get('startStationName')
endStationName = request.args.get('endStationName')
应该打印一个定义了startStationName 和endStationName 的字典。
然而,似乎只收到了第一个参数:
ImmutableMultiDict([('startStationName', u'Hansard Mews, Shepherds Bush')])
有人知道我做错了什么吗?我感觉某处一定有什么愚蠢的错误或误解,但我找了一个小时也没找到。
【问题讨论】:
-
你错过了 shell 上的
[1] <process number>和[1]+ Exit <exit code>输出..