ERROR: No api proxy found for service "urlfetch"
def test_urlfetch():
import urllib
from google.appengine.api import urlfetch # default is 5 second timeout
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import urlfetch_stub
apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
apiproxy_stub_map.apiproxy.RegisterStub( 'urlfetch',urlfetch_stub.URLFetchServiceStub() )
response = requests.get( BASE + USER_LIST + AUTH_TOKEN_PARAMETER )
users = json.loads( response.content )[ 'users' ]
name = str( time.time() )
parameters = { 'name': name, 'owner_user_id': users[0]['user_id'], 'auth_token': AUTH_TOKEN }
# response = requests.post( BASE + ROOM_CREATE, params=parameters ) #an easier, non Google, way of getting things
encoded_parameters = urllib.urlencode( parameters )
result = urlfetch.fetch( url=BASE + ROOM_CREATE, payload=encoded_parameters, method=urlfetch.POST )
print result.status_code
print result.content