Skip to content

Instantly share code, notes, and snippets.

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

  • Save tkaemming/c3a57cd9d0b3377803c70d01866fb1d9 to your computer and use it in GitHub Desktop.

Select an option

Save tkaemming/c3a57cd9d0b3377803c70d01866fb1d9 to your computer and use it in GitHub Desktop.

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))