Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 2393463

Browse files
authored
Merge pull request #269 from kracekumar/development
Convert HTTP method to upper case before making request
2 parents 73d04f1 + 67529be commit 2393463

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

hyper/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def set_request_data(args):
195195
if args.method is None:
196196
args.method = 'POST' if args.body else 'GET'
197197

198+
args.method = args.method.upper()
198199
args.headers = headers
199200

200201

test/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def test_cli_with_system_exit(argv):
104104

105105
@pytest.mark.parametrize(('argv', 'expected'), [
106106
(['--debug', 'example.com'], {'debug': True}),
107+
(['get', 'example.com'], {'method': 'GET'}),
107108
(['GET', 'example.com', 'x-test:header'],
108109
{'method': 'GET', 'headers': {'x-test': 'header'}}),
109110
(['GET', 'example.com', 'param==test'],
@@ -119,6 +120,7 @@ def test_cli_with_system_exit(argv):
119120
'x-test': 'header'}}),
120121
], ids=[
121122
'specified "--debug" option',
123+
'specify host with lower get method',
122124
'specified host and additional header',
123125
'specified host and get parameter',
124126
'specified host and post data',

0 commit comments

Comments
 (0)