Python 无法识别两个URL参数

Python 无法识别两个URL参数,python,rest,flask,Python,Rest,Flask,我正在尝试向使用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=['G

我正在尝试向使用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
的dict

但是,似乎只接收到第一个参数:

ImmutableMultiDict([('startStationName', u'Hansard Mews, Shepherds Bush')])

有人知道我做错了什么吗?我有一种感觉,在某个地方一定有某种愚蠢的错误或误解,但我已经找了一个小时,却找不到它。

你的外壳将
&
解释为一个错误。要防止出现这种情况,请引用整个URL:

curl -i "http://127.0.0.1:5000/api/journeys/count?startStationName=Hansard%20Mews,%20Shepherds%20Bush&endStationName=Farringdon%20Lane,%20Clerkenwell"

您错过了shell上的
[1]
[1]+Exit
输出。啊,太棒了,它现在可以工作了。谢谢很高兴我现在问了,否则我早就挠头了。