#!/usr/bin/python import httplib import argparse parser = argparse.ArgumentParser() parser.add_argument("method") parser.add_argument("path") parser.add_argument("body") args=parser.parse_args() connection = httplib.HTTPConnection('127.0.0.1:9000') connection.request(args.method, args.path, args.body) print connection.getresponse().read()