Cranjis
Cranjis

Reputation: 1960

passing URL as args to handler in apps-engine

I want to create an apps enginge that get command via url. How can I acsees the URL from within the handlers?

class Handler:
    def get(self):
        url = ? #Here I want to access the url and parse it
        self.response.write(url)

def main():
   application = webapp.WSGIApplication([
           ('/get',   Handler)])

Upvotes: 0

Views: 40

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39834

I'm accessing the request URL like this:

logging.info('URL: %s' % self.request.path_info)

I am using webapp2, it's true, but it should work with webapp as well as path_info actually comes from webob, which both frameworks are based on.

Upvotes: 1

Related Questions