You used gzip.GzipFile
, which writes a gzip file header that you need to strip off the data before passing it into gzinflate
; then, by the look of your code, you probably want to do something like parse_str on it:
$str = gzinflate(substr($postdata, 10, -8));
parse_str($str, $a);
echo $a['sql'];
Also, in your python code, there's either a typo or a fundamental error on this line:
dictheaders = {'sql', 'SELECT * FROM employees'}
Try this instead:
dictheaders = {'sql': 'SELECT * FROM employees'}