问题
this is my code:
url = "/aa"
result = urlfetch.fetch(url)
but it will be error , because you have to get the full url , like this :http://digu.com
so any easy way to get the full url in my code ,
thanks
回答1:
Do you mean the full URL of your own app?
You might want self.request.host
(which would be eg digu.com) or self.request.host_url
(which would be eg http://digu.com).
See the documentation for the app engine Request class, and also the WebOb Request class it is based on.
However, why would you make a urlfetch to your own app?
来源:https://stackoverflow.com/questions/4094715/has-any-easy-way-to-get-full-url-using-python-on-gae