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

Change default JSON Accept to application/json, */*;q=0.5

Close #488
This commit is contained in:
Jakub Roztocil
2020-04-13 22:12:06 +02:00
committed by GitHub
parent 684a4708d7
commit cdf691c212
4 changed files with 18 additions and 12 deletions

View File

@@ -22,6 +22,7 @@ def test_default_headers_case_insensitive(httpbin):
assert 'Content-Type' not in r
# noinspection PyPep8Naming
class TestImplicitHTTPMethod:
def test_implicit_GET(self, httpbin):
r = http(httpbin.url + '/get')
@@ -51,9 +52,9 @@ class TestImplicitHTTPMethod:
class TestAutoContentTypeAndAcceptHeaders:
"""
Test that Accept and Content-Type correctly defaults to JSON,
but can still be overridden. The same with Content-Type when --form
-f is used.
Test that `Accept` and `Content-Type` correctly default to JSON,
but can still be overridden. The same with Content-Type when `--form`
`-f` is used.
"""
@@ -84,7 +85,7 @@ class TestAutoContentTypeAndAcceptHeaders:
assert r.json['headers']['Accept'] == JSON_ACCEPT
assert r.json['headers']['Content-Type'] == 'application/json'
def test_POST_explicit_JSON_auto_JSON_accept(self, httpbin):
def test_POST_explicit_JSON_JSON_ACCEPT(self, httpbin):
r = http('--json', 'POST', httpbin.url + '/post')
assert HTTP_OK in r
assert r.json['headers']['Accept'] == JSON_ACCEPT