1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Issue #54 Method suggestion proposal

This commit is contained in:
Vladimir Berkutov
2012-06-17 21:46:56 +04:00
parent 78fff98712
commit bca36f0464
6 changed files with 160 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python
import re
import sys
import json
@@ -41,12 +40,6 @@ def _get_response(parser, args, stdin, stdin_isatty):
# Form
args.headers['Content-Type'] = TYPE_FORM
if args.method is None and not args.items:
args.method = 'GET'
elif not re.match('^[a-zA-Z]+$', args.method):
args.items.insert(0, args.url)
args.method, args.url = 'POST', args.method
# Fire the request.
try:
credentials = None