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

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


Hi,

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
�e
# length is 45

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

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


thanks,
Subeen.
http://love-python.blogspot.com



More information about the Python-list mailing list