Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created May 2, 2016 18:34
  • Select an option

Select an option

Revisions

  1. ted kaemming created this gist May 2, 2016.
    8 changes: 8 additions & 0 deletions read-payload.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    import base64, json, sys, zlib

    request = sys.stdin.read()
    headers, payload = request.split('\r\n\r\n', 1)

    result = json.loads(zlib.decompress(base64.b64decode(payload)))

    sys.stdout.write(json.dumps(result, indent=2))