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

Added support for request payload from a filepath

Content-Type is detected from the filename.

Closes #57.
This commit is contained in:
Jakub Roztocil
2012-06-29 00:45:31 +02:00
parent 41d640920c
commit 50196be0f2
6 changed files with 72 additions and 18 deletions

View File

@@ -24,8 +24,8 @@ def _get_response(parser, args, stdin, stdin_isatty):
'Content-Type' not in args.headers
and (args.data or args.json)):
args.headers['Content-Type'] = TYPE_JSON
if stdin_isatty:
# Serialize the parsed data.
if isinstance(args.data, dict):
# Serialize the data dict parsed from arguments.
args.data = json.dumps(args.data)
if 'Accept' not in args.headers:
# Default Accept to JSON as well.