zjm1126
zjm1126

Reputation: 35670

has any easy way to get full url using python on gae

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

Upvotes: 1

Views: 742

Answers (1)

Saxon Druce
Saxon Druce

Reputation: 17624

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?

Upvotes: 5

Related Questions