Search code examples
google-app-enginehttpwebapp2

make http request inside google app engine, python


I want to send a request from my google app engine to another server, currently i am using python and Webapp2 framework. I think it should to be similar to curl library in php ! How could i do that ?thanks


Solution

  • import urllib2
    
    url = "http://www.google.com/"
    try:
      result = urllib2.urlopen(url)
      doSomethingWithResult(result)
    except urllib2.URLError, e:
      handleError(e)
    

    https://developers.google.com/appengine/docs/python/urlfetch/