Google App Engine Support

Http Lib2 works on google app engine and requests should support it too.


Requests supports Python 2.5. Is more required?


Google app engine works a bit differently.. from google.appengine.api import urlfetch

You have any ideas!


Hmm. `urlfetch` already looks a bit like requests.


let me give a bit more perpective.. im a the lead developer of https://github.com/plivo/plivohelper-python and we currently support both. requests would remove lot of boiler plate for us :) hence asking if you had a chance to test this stuff?


@bevenky, I'd love to add a compatibility layer. It's truly a shame that Google doesn't just include the full standard library though. Very odd ;)


that would be great.. :) already sold on this.. will wait for gae support :)


It was my understanding that `urllib`, `urllib2`, and `httplib` are monkey patched on app engine to use `urlfetch` under the hood. What changes would need to be made to `requests`?


@derferman, if that's the case, then everything should work perfectly!


According to http://code.google.com/appengine/kb/libraries.html

the `select` module is not allowed on app engine, but is being used in `packages/urllib3/connectionpool.py`


Well, I think App Engine is crazy :)


I think you're crazy.   GAE is "crazy" because in order to support a seamlessly scalable environment, you have to put certain restrictions on what a program can do in the environment.  In Java you'd do so by applying a security manager, in python, you have to replace parts of the "standard" libraries to prevent users from doing nasty things to your carefully managed environment.

Craziness aside, you think you can fix this issue?  I was happy to find requests solved my cookie and header handling problems in 5 minutes what I'd been scouring python docs and google references for hours trying to figure out, but then failed miserably when actually put in the app engine environment.  I suppose I'd be happy to make a patch if you say "I'm too busy, make a patch", but it'd take me a long while to find solutions and then narrow them to the _appropriate_ solutions.


I have no problem supporting app engine, but I'm not bending over backwards for it.

It sounds like the problem is in urllib3, not requests.


BTW, I don't quite understand why the import should be attempted on a synchronous GET, although I'm something of a python newbie, so there may be some convoluted logic why a GET doesn't boil down to a socket connect followed by a few writes and reads.


Connection pooling?


@kennethreitz: @twall and I are coworkers, and we're working together to get requests working on App Engine. I've forked the project, and I believe my fork works properly. I had to make a bunch of changes that are specific to Python 2.5, so I don't know if you'll be able to actually pull my changes in, but I'll create a pull request for you to review, anyway. Also, that way, when people ask about requests on App Engine, you can point them at my fork!


@singingwolfboy I'd be happy to accept a pull request that works with  2.6–3.2 (I know App Engine supports 2.7), but the urllib3 changes need to occur in the urllib3 repository.


https://github.com/shazow/urllib3


FYI: Related urllib3 discussion is here: https://github.com/shazow/urllib3/issues/61


Alright, urllib3 seems to be working on AppEngine now, pull the latest master. :)