2012-07-21 | Paul Boddie | file changeset files shortlog | Restructured the action so that both signed and signed/encrypted messages can be processed. Split the posting test program into separate signing, encryption and posting programs. Added a default mask command to the initialisation script. |
paul@0 | 1 | #!/usr/bin/env python |
paul@0 | 2 | |
paul@0 | 3 | import httplib |
paul@0 | 4 | import sys |
paul@0 | 5 | |
paul@0 | 6 | if __name__ == "__main__": |
paul@0 | 7 | host = sys.argv[1] |
paul@0 | 8 | path = sys.argv[2] + "?action=PostMessage" |
paul@0 | 9 | |
paul@5 | 10 | text = sys.stdin.read() |
paul@0 | 11 | |
paul@0 | 12 | req = httplib.HTTPConnection(host) |
paul@0 | 13 | req.request("PUT", path, text) # {"Content-Length" : len(text)} |
paul@0 | 14 | resp = req.getresponse() |
paul@0 | 15 | print resp.read() |
paul@0 | 16 | |
paul@0 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |