在应用引擎上卷曲

Bun*_*bit 13 google-app-engine curl

可以卷曲在谷歌应用程序引擎上使用?

Woo*_*ble 13

不能.要发出HTTP请求,您需要使用urlfetch服务.

App Engine上的urllib,urllib2和httplib已经过修补,可以透明地为您使用此API,因此使用这些标准模块之一执行HTTP请求的任何第三方模块都可以使用.

cURL中的'c'是因为库是用C语言编写的; 其他语言的cURL接口(如pycurl)使用libcurl库,不能在App Engine上使用,因为不允许在C扩展上回复的模块.


小智 5

我建议使用URL提取服务.例如在python中

from google.appengine.api import urlfetch

url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
  doSomethingWithResult(result.content)
Run Code Online (Sandbox Code Playgroud)