Reputation: 9507
So, within a webapp.RequestHandler subclass I would use self.request.uri
to get the request URI. But, I can't access this outside of a RequestHandler and so no go. Any ideas?
I'm running Python and I'm new at it as well as GAE.
Upvotes: 1
Views: 811
Reputation: 33190
Since using request outside code handling it is meaningless I assume you'd like to access it from some method called by handler without passing request to it. Your choices are:
threading.local()
, storing request somewhere in request handler and access it in your method.Upvotes: 0
Reputation: 89847
You should generally be doing everything within some sort of RequestHandler or the equivalent in your non-WebApp framework. However, if you really insist on being stuck in the early 1990s and writing plain CGI scripts, the environment variables SERVER_NAME and PATH_INFO may be what you want; see a CGI reference for more info.
Upvotes: 2