1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Issue #54 Method suggestion proposal

This commit is contained in:
Vladimir Berkutov 2012-06-17 22:15:07 +04:00
parent d920f20847
commit 0e1affbbc4

View File

@ -90,7 +90,7 @@ class HTTPieArgumentParser(argparse.ArgumentParser):
args.url = args.method
args.items.insert(0, item)
# Check if any data item presents
if any(item[2] in ('=', ':=', '@') for item in args.items):
if any(item[2] in (SEP_DATA, SEP_DATA_RAW_JSON, SEP_FILES) for item in args.items):
args.method = 'POST'
else:
args.method = 'GET'