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

Commit

Permalink
Merge pull request #269 from kracekumar/development
Browse files Browse the repository at this point in the history
Convert HTTP method to upper case before making request
  • Loading branch information
Lukasa committed Aug 7, 2016
2 parents 73d04f1 + 67529be commit 2393463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions hyper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def set_request_data(args):
if args.method is None:
args.method = 'POST' if args.body else 'GET'

args.method = args.method.upper()
args.headers = headers


Expand Down
2 changes: 2 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def test_cli_with_system_exit(argv):

@pytest.mark.parametrize(('argv', 'expected'), [
(['--debug', 'example.com'], {'debug': True}),
(['get', 'example.com'], {'method': 'GET'}),
(['GET', 'example.com', 'x-test:header'],
{'method': 'GET', 'headers': {'x-test': 'header'}}),
(['GET', 'example.com', 'param==test'],
Expand All @@ -119,6 +120,7 @@ def test_cli_with_system_exit(argv):
'x-test': 'header'}}),
], ids=[
'specified "--debug" option',
'specify host with lower get method',
'specified host and additional header',
'specified host and get parameter',
'specified host and post data',
Expand Down

0 comments on commit 2393463

Please sign in to comment.