On 18/01/16 02:13, sudipto manna wrote: > Here is the code snippet: > > File#FlaskTest2.py > > from flask import Flask > > app = Flask(__name__) > > #Make an app.route() decorator here > @app.route("/puppies/", methods = ['GET' , 'POST']) > def puppiesFunction(): > if request.method == 'GET': > return getAllPuppies() > As suspected the error is correct. You do not have a request object anywhere in your code. A quick Google tells me that it is part of Flask. So you need to import request from your flask module:
from flask import Flask, request,,....# any other names you use hth -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor