I'm generating gzip files from python using the following code: (using python 3)
file = gzip.open('output.json.gzip', 'wb')dataToWrite = json.dumps(data).encode('utf-8')file.write(dataToWrite)file.close()
However, I'm trying to read this file now in Javascript using the Pako library (I'm using Angular 2):
this.http.get("output.json.gzip").map((res:Response) => {var resText:any = new Uint8Array(res.arrayBuffer());var result = "";try {result = pako.inflate(resText, {"to": "string"});} catch (err) {console.log("Error " + err);}return result;});
But I'm getting this error in the console: unknown compression method
. Should I be doing something else to properly inflate gzip files?