1
0
mirror of https://github.com/httpie/cli.git synced 2026-06-20 11:32:56 +02:00

Set JSON Content-Type only with data even with -j.

This commit is contained in:
Jakub Roztocil
2012-08-06 22:14:52 +02:00
parent 4e58a3849a
commit 44e409693b
4 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -386,15 +386,15 @@ class AutoContentTypeAndAcceptHeadersTest(BaseTestCase):
self.assertIn('"Accept": "application/json"', r)
self.assertIn('"Content-Type": "application/json; charset=utf-8', r)
def test_POST_explicit_JSON_auto_JSON_headers(self):
def test_POST_explicit_JSON_auto_JSON_accept(self):
r = http(
'--json',
'POST',
httpbin('/post')
)
self.assertIn(OK, r)
self.assertIn('"Accept": "application/json"', r)
self.assertIn('"Content-Type": "application/json; charset=utf-8', r)
self.assertEqual(r.json['headers']['Accept'], 'application/json')
self.assertNotIn('Content-Type', r.json['headers'])
def test_GET_explicit_JSON_explicit_headers(self):
r = http(