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
2 Answers
There is also the urlfetch service. urllib2 uses this, so for simple tasks urlfetch is usually a little easier. However urlfetch is specific to appengine, so that is a reason not to use it if you want portable code.
See docs https://developers.google.com/appengine/docs/python/urlfetch/
Comments
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/
2 Comments
user3516596
thank you very much :) I can use this to connect to gcm server ,that is right?
Paul Collingwood
np. Don't know much about gcm, but if you can interact with it over http then yes.