I'm building an application in Python on App Engine. My application
receives images as email attachments. When an email comes in, I grab
the image and need to send it to a third party API.

The first thing I did was:
1) make a POST request to the third party API with the image data

I stopped this method because I had some pretty bad encoding problems
with urllib2 and a MultipartPostHandler.

The second thing I'm doing right now is
1) Put the image in the incoming email in the Datastore
2) Put it in the memcache
3) Send to the API an URL that serves the image (using the memcache
or, if not found in the memcache, the Datastore)

The problem I read on my logs is: DeadlineExceededError:
ApplicationError: 5

More precisely, I see two requests in my logs:
- first, the incoming email (ends up with the DeadlineExceededError)
- then, the third party API HTTP call to my image on the URL I gave
him (ends up fine, serving correctly the image)

My interpretation:
It looks like App Engine waits for a response from the third party
API, then closes because of a timeout, and then serves the request
made by the third party API for the image. Unfortunately, as the
connection is closed, I cannot get the useful information provided by
the third party API once it has received my image.

My questions:
1) Can App Engine handle a request from a host it supposes to get a
response of?
2) If not, how can I bypass this problem?

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

Reply via email to