1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00
This commit is contained in:
Jakub Roztocil 2013-04-12 15:27:26 -03:00
parent 289e9b844e
commit 1681a4ddd0
2 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,7 @@ def get_requests_kwargs(args):
}
auto_json = args.data and not args.form
# FIXME: Accept is set to JSON with `http url @./file.txt`.
if args.json or auto_json:
implicit_headers['Accept'] = 'application/json'
if args.json or (auto_json and args.data):

View File

@ -793,6 +793,8 @@ class RequestBodyFromFilePathTest(BaseTestCase):
"""
def test_request_body_from_file_by_path(self):
# FIXME: *sometimes* fails on py33, the content-type is form.
# https://github.com/jkbr/httpie/issues/140
r = http(
'POST',
httpbin('/post'),
@ -803,6 +805,8 @@ class RequestBodyFromFilePathTest(BaseTestCase):
self.assertIn('"Content-Type": "text/plain"', r)
def test_request_body_from_file_by_path_with_explicit_content_type(self):
# FIXME: *sometimes* fails on py33, the content-type is form.
# https://github.com/jkbr/httpie/issues/140
r = http(
'POST',
httpbin('/post'),