AppEngine:我可以获取内部网址吗?
有谁知道我是否可以从我的 AppEngine 应用程序中获取内部 AppEngine 网址?
官方 URL Fetch Python API 并未涵盖这一点。 http://code.google.com/intl /et-EE/appengine/docs/python/urlfetch/overview.html
我尝试了不同的可能性,但似乎没有任何效果。以前有人这样做过吗?
urllib2.urlopen('http://127.0.0.1:8080/start_something/') 或者 urllib2.urlopen('/start_something/') ...
提前致谢。
Does anyone know, if I can fetch an internal AppEngine url from within my AppEngine app?
The official URL Fetch Python API doesn´t cover that.
http://code.google.com/intl/et-EE/appengine/docs/python/urlfetch/overview.html
I tried different possibilities, but as it seems nothing works. Does anyone did that before?
urllib2.urlopen('http://127.0.0.1:8080/start_something/')
or
urllib2.urlopen('/start_something/')
...
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对于开发服务器根本不起作用。它是单线程的,因此尝试在其请求处理程序之一内加载应用程序的 URL 之一将挂起,直到 URLFetch 超时。
它在生产中应该不会出现任何问题。
要解决开发服务器的限制,您应该在不同的端口上运行两个实例。
This will not work at all with the development server. It is single-threaded, so trying to load one of your app's URL's while inside one of its request handlers will hang until the URLFetch times out.
It should work with no problems at all in production.
To get around the development server limitation, you should run two instances on different ports.