0

I am using the Pako NPM package like so: pako.deflate(JSON.stringify(json), { to: 'string' }) to compress a JSON payload and am able to open it up correctly over a REST call by using JSON.parse(pako.inflate(response.body, { to: 'string' })) via another Node.js service successfully.

However, when trying to inflate and view the JSON in a Ruby environment, I'm consistently getting 'inflate': incorrect header check (Zlib::DataError) using Zlib::Inflate.inflate(resp.body). So, in general, how does one get this data viewable from a potentially different language driven micro service by using zlib (or is there another package that can do this...)?

nilpop
  • 1
  • 2
  • Check out this answer https://stackoverflow.com/a/22310760/4950680. Might be useful in your case – Martin Jun 01 '19 at 17:00
  • Thanks for the link! All this stuff lead me down a cool path to better understand compression and character encoding. However, we ended up just storing large payloads of JSON in AWS S3 for now. I'm going to further investigate encoding and compressing in 1 language/runtime and uncompressing it via different languages as micro services in the near future and will post a link to that article/post on this SO question. – nilpop Jun 03 '19 at 13:59
  • Great! Looking forward to it – Martin Jun 04 '19 at 08:46

0 Answers0