Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在python AppEngine中构建请求时获取url?_Python_Google App Engine_Urlfetch - Fatal编程技术网

如何在python AppEngine中构建请求时获取url?

如何在python AppEngine中构建请求时获取url?,python,google-app-engine,urlfetch,Python,Google App Engine,Urlfetch,为了能够在有人点击我的服务的url时生成get响应,当我构建它时,我希望从同一服务获取url/retrieve\u data/。我怎样才能在不同的线程中启动它,从而避免收到超过死线的错误?我使用的是python 2.7,带有threadsafe=true 因此,对于/show\u data/处理程序,我有类似的内容: def get(self): url = '/retrieve_data/' data_from_my_service = urlfetch.fetch(url) do

为了能够在有人点击我的服务的url时生成get响应,当我构建它时,我希望从同一服务获取url
/retrieve\u data/
。我怎样才能在不同的线程中启动它,从而避免收到超过死线的错误?我使用的是python 2.7,带有
threadsafe=true

因此,对于
/show\u data/
处理程序,我有类似的内容:

def get(self):
  url = '/retrieve_data/'
  data_from_my_service = urlfetch.fetch(url)
  do_something_with_data(data_from_my_service)
  self.redirect('/')

您应该使用(不需要涉及线程)。

您应该使用(不需要涉及线程)。

当您可以选择直接使用服务而不使用http往返时,为什么需要获取url?因为我的数据(json)存储为blob。所以我需要提供服务。无论数据是如何存储的,都不需要对自己使用HTTP请求——只要使用适当的API直接检索数据即可。如果您可以选择直接使用服务而不使用HTTP往返,为什么还要获取url?因为我的数据(json)存储为blob。所以我需要为它服务,不需要对自己使用HTTP请求,不管数据是如何存储的,只要使用适当的API直接检索数据即可。