You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2026-04-24 19:53:55 +02:00
-j/--json now adds "Accept": "application/json" to GET requests if no previous Accept header exists.
This commit is contained in:
@@ -94,6 +94,10 @@ class TestHTTPie(BaseTest):
|
||||
def test_json(self):
|
||||
response = http('POST', 'http://httpbin.org/post', 'foo=bar')
|
||||
self.assertIn('"foo": "bar"', response)
|
||||
response2 = http('-j', 'GET', 'http://httpbin.org/headers')
|
||||
self.assertIn('"Accept": "application/json"', response2)
|
||||
response3 = http('-j', 'GET', 'http://httpbin.org/headers', 'Accept:application/xml')
|
||||
self.assertIn('"Accept": "application/xml"', response3)
|
||||
|
||||
def test_form(self):
|
||||
response = http('--form', 'POST', 'http://httpbin.org/post', 'foo=bar')
|
||||
|
||||
Reference in New Issue
Block a user