ruby - How to decompress this zlib compressed response -


i'm using charles proxy analyse traffic of app. responses seem have zlib compression.

here's example of data returns:

{    "securityproxyresponseenvelope":{       "resultcode":"ok",       "apiresponse":"{zlibe}9mtde350h9rd4h7wlfx3akectnsb40ffaezal/cfcnnkrhgxawhgas2ri4rnegiwlpgjkkl+qkb0kzj6+zfmmz12pl9/9mpda1unukl5odhcwmazim3zjdxfgcw4zrucs/iosiu1qvkaf5qibocb4+2raf7zh18srtmxm8yw3eys5w1npjmykm31w8x7qvrkkzfsch3kqdwmyn0i2gnnotfwukjwd5snunyqxpopzhnx3cbdw/pj4+n0tjxjaohorce8ypmjxnvh3zthkltbiblgeulh1hgvvtki0c9pgmyt/92upvw6qhxqcyoo/ltjk1tq6opbnmrbnzddntsrkrzp+1rpvzbbxftwq9jh45esthbg5hq+d2ojkw5zrgi6tm8eg4ztcqroo9devz2jbqsdctpz70+c6ipydkvoyqji18ysljbbgchw1j45yitcurvxp0fchxxrnhzwu6m430xkep7onxvgezurt3t8qajrkrbhfd8jrjdyduxysmoa",       "session":"n3qp6jzhwzkxwsmw3vbf:jitqbjbmlzbrgcegy7od",       "parameters":{        }    } } 

i've tried deflating using:

zlib::deflate.deflate(data) # => "x\x9c\x05\xc1e\xb6\xab0\x00\x00\xd0\x051\xc0)\fq\x97*2+r )\x16\x824\xef\xfc\xbd\xff{\xff\xc8\xb7/\x9b\x7f\xca\x80k\x93\x17\x99na\xb5\xd0]\x8e\xaf\x95\xf1*lt\x1c\xad\xa5\xc0x\xd6\xdb,\xd4/\xad\x7f\xaa(\xf2qgg\xef\xa3k\xd5\x95c\xae\x80f\xb3u\x8f`n=\xe8\x7f\xa9\x05j\f$\x9ed\x15\xd60\x10\x96k\xbe\n\xad\x84i\xad\xb2\xdb\xf8\xf4\x031\xae\x9d*\x1d\xd4\xa2\x1f\xf8\x02\x18\x99e\xeb\xa9@\xd0\xa6\xdfi7\xbe\xf7ovy\xf9\xaa%.n9u\x9a@qh\xb5.\xc4a\xe5\xfb\r\x0fy(\xe7)\xdf\xe4\xabx\xb0q\x02\x86\x1c\x86<\x9b\xca\xe7\xe5\xba#\x1f\x12k\xad\x1c\x1e.\xc61\xe4#\xe3rm\x14\xc5\xf8sl>hkq\x1d\xb7\xf1\xb7\x9c\xc94\x17n\x94\xf1\xbav\xa7\xf4\f\x04*b\xb0\x97\x01ur&\xa47r>\x0f\xe0\x1c\xf7\x8e'\xb8\x83\xc1\xa3\xec\xb5\xa0m\x9e\x81\xc3v\xf6\xfe\xc2\xd0et%\xb1\xc3\x1f\xa6\x15n\x9b_\xa9\xb48\xe7\xa2\xe7sl\a\x0f\xcfg\xf1\"\xc5\xb36\x867-*\fc\xc4\xf7\edd\xa6\xd8\xdb\xbc\x93r;-|\\\x15\xd0\tbs\xc7]i\x8b\xddb\x19\xdc\xe4\xc1t$\xc8\xee\xa5g(7\xb6@\xb0\xbe\xdc\xa6x\xa9\xcd\x9dp^y]\r\xfd\x91\x90\vc\xe9r\x9f\xe45\xdc\xe3\xdf\x02zv\xfe\xad\x01\xd0j\xbbr\x0e\x16\bb\xee\xe2jc\xafsf,\xbd;34:\xc5\xb1i\x83\xc03\xa7o\xce\x978:\xf7\xd6,6\x84\xf9\x87\xbc\xa8\x00at:\x9fz\x067`\xfc\xeag\x96\xaf\xe1\xf4\xfe\x0f\xaf\x1d\xb0\xb3" 

but doesn't work.

how can decompress string in data['securityproxyresponseenvelope']['apiresponse']?

deflate() compresses. ending string "{zlibe}9mtde..." compressed zlib format. want use inflate() decompress.

having said that, if assume characters after "{zlibe}" base-64 encoded, don't find zlib or raw deflate compressed data in there. have documentation on "{zlibe}" means?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -