I'm having trouble with request size limiting, but I don't understand
why.  Im this blog post (http://googleappengine.blogspot.com/2009/02/
skys-almost-limit-high-cpu-is-no-more.html) and it seems to say that
the limits on requests and responses were increased to 10mb.  My
application receives emails and then forwards them on to a website I
run using urlfetch.  Whenever I send an email with an attachment over
1mb, I see these RequestTooLargeError errors.  Here is the actual
piece of code that is failing, the error is occurring on the response
= fetch line:

import logging, email, yaml
from django.utils import simplejson as json
from google.appengine.ext import webapp
from google.appengine.ext.webapp.mail_handlers import
InboundMailHandler
from google.appengine.api.urlfetch import fetch
from google.appengine.api.urlfetch import Error as FetchError

settings = yaml.load(open('settings.yaml'))

def callback(raw):
  result = {'email': {'raw': raw}}

  response = fetch(settings['outbound_url'],
              payload=json.dumps(result),
              method="POST",
              headers={
                'Authorization': settings['api_key'],
                'Content-Type': 'application/json'
              },
              deadline=10
             )
  logging.info(response.status_code)
  if response.status_code != 200:
    raise FetchError()

class InboundHandler(InboundMailHandler):
  def receive(self, message):
    logging.info("Received a message from: " + message.sender)
    callback(message.original.as_string(True))


It would be great if someone could explain to me why this is not
working and how I can get around it, thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to