Trouble sending / receiving compressed data (using zlib) as HTTP POST to server (in django)

subeen tamim.shahriar at
Sat Oct 3 09:45:41 CEST 2009


I am trying to send compressed data to a server written in django. But
it shows error while decompressing the data in the server. After some
experiment I found that the server is not receiving the exact data I
am sending.

data = 'hello, this is a test message this is another message'
data = zlib.compress(data)
# now it looks like: x��H����Q(��,V�D�����������T�p^~IFjL
# length is 45

in django (view) I receive it:
data = request.POST['data']
# now it looks like: x����Q(�,V�D�������^~IFjL
# length is 34

Can anybody help me understand the issue and how to get over?


More information about the Python-list mailing list