jwesonga
jwesonga

Reputation: 4383

Mapping URLs in my handler script in App Engine

I have

class Auth(webapp.RequestHandler):
    def get(self,username,password):
        self.response.out.write("auth" + self.request.get("username"))

The structure of my URL will be:

/api/auth/?username=xxxx&password=xxxx

How do I map this URL in my handler script?

Upvotes: 1

Views: 403

Answers (1)

systempuntoout
systempuntoout

Reputation: 74134

Handler:

class Auth(webapp.RequestHandler):
    def get(self):
        self.response.out.write("username" + self.request.get("username"))
        self.response.out.write("password" + self.request.get("password"))

Url:

/api/auth?username=xxxx&password=xxxx

Application:

application = webapp.WSGIApplication([
    ('/api/auth', Auth),
    ], debug=True)

Upvotes: 4

Related Questions