0
這是我的代碼幫助服務器錯誤....請在Foursquare和Heroku的API使用python
http://drut1.herokuapp.com/search/?lat=51&lng=-3&amenity=coffee
我在哪裏去了?它是代碼嗎?
這是我的代碼幫助服務器錯誤....請在Foursquare和Heroku的API使用python
http://drut1.herokuapp.com/search/?lat=51&lng=-3&amenity=coffee
我在哪裏去了?它是代碼嗎?
首先你的代碼中有一些語法錯誤。
app.route('/search/',methods=['GET'])
應該是:
@app.route('/search',methods=['GET'])
和:
lat = request.args.get(lat)
應該
lat = request.args.get('lat')
我在本地測試你的代碼,而Foursquare的一部分,它的工作原理是預期。
@app.route('/search',methods=['GET'])
def search():
lat = request.args.get('lat')
lng = request.args.get('lng')
amenity = request.args.get('amenity')
params='ll',str(lat) + ',' + str(lng)+str(amenity)
#client =foursquare.Foursquare(client_id='',client_secret='')
#return jsonify(message=client.venues.search(params))
return 'OK'
1.您可以更好地設置您的代碼的格式,以便閱讀嗎? 2.請給我們提供任何python輸出給你,這樣可以更容易地診斷問題 – octopi