Python 从应用程序引擎发送HTTP请求
是否可以从AppEngine应用程序发送HTTP请求?我需要提出一些请求并从其他站点获取一些数据。是。更多信息请点击此处: 您可以使用Python标准 库urllib、urllib2或httplib 发出HTTP请求。磨合时 应用程序引擎,这些库执行 使用应用程序引擎URL的HTTP请求 获取服务,运行在谷歌的 可扩展的HTTP请求基础架构 下面是一个例子:Python 从应用程序引擎发送HTTP请求,python,google-app-engine,Python,Google App Engine,是否可以从AppEngine应用程序发送HTTP请求?我需要提出一些请求并从其他站点获取一些数据。是。更多信息请点击此处: 您可以使用Python标准 库urllib、urllib2或httplib 发出HTTP请求。磨合时 应用程序引擎,这些库执行 使用应用程序引擎URL的HTTP请求 获取服务,运行在谷歌的 可扩展的HTTP请求基础架构 下面是一个例子: import urllib from xml.dom import minidom from google.appengine.api i
import urllib
from xml.dom import minidom
from google.appengine.api import urlfetch
params = urllib.urlencode({'p': loc_param, 'u': units,})
full_uri = '?'.join([url, params,])
result = urlfetch.fetch(full_uri)
if result.status_code == 200:
return minidom.parseString(result.content)
您也可以直接使用urllib和urllib2;它们经过修补,可以为您使用urlfetch服务。