Comments
Patch
@@ -37,6 +37,8 @@
help='Write HTTP response body to a file')
parser.add_argument('--showdynamicheaders', action='store_true',
help='Show dynamic headers that are hidden by default')
+parser.add_argument('--method', default='GET',
+ help='HTTP request method')
parser.add_argument('host')
parser.add_argument('path')
parser.add_argument('show', nargs='*')
@@ -64,7 +66,7 @@
headers[key] = value
conn = httplib.HTTPConnection(host)
- conn.request("GET", '/' + path, None, headers)
+ conn.request(args.method.encode('ascii'), '/' + path, None, headers)
response = conn.getresponse()
stdout.write(b'%d %s\n' % (response.status,
response.reason.encode('ascii')))