chunked transfer encoding

290 views
Skip to first unread message

jeremy

unread,
Feb 20, 2009, 3:29:47 AM2/20/09
to Google App Engine
i'm running into some difficult with chunked transfer encoding. i'm
certain that the client is transmitting a body, but the request
handler has an empty body.

this seems to be a long standing issue: http://code.google.com/p/googleappengine/issues/detail?id=129

is there a work around? is it only on the sdk?

jeremy

unread,
Feb 20, 2009, 3:39:46 AM2/20/09
to Google App Engine
so using netcat as a dummy host, i've confirmed the client is sending
the data i expect:


####################################

POST /_datum/blaaah.bin HTTP/1.1
Transfer-Encoding: chunked
Content-Type: multipart/form-data; boundary=A-
mBZUkudNqt56TwNWjHhJy91U2HlskAAyqGEzwn
Host: localhost:8088
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.0-beta2 (java 1.5)
Expect: 100-Continue

2c
--A-mBZUkudNqt56TwNWjHhJy91U2HlskAAyqGEzwn

91
Content-Disposition: form-data; name="content"; filename="content"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

<and then a lot of scary binary data>

####################################

but self.request.get('content') in the request handler returns an
empty string....

James Ashley

unread,
Feb 21, 2009, 7:47:42 PM2/21/09
to Google App Engine
Just a gut reaction...shouldn't that be self.request.post?

Scott Seely

unread,
Feb 22, 2009, 8:48:36 AM2/22/09
to google-a...@googlegroups.com
Nope-- self.request.get is correct. The code should be in a post handler,
something like this:

class YourPage(webapp.RequestHandler):
def post(self):
theContent = self.request.get('content')
# code to do something with the item...

Sorry I don't have anything more to provide-- I just wanted to clarify that
your code looks right.
Reply all
Reply to author
Forward
0 new messages