You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Support multiple headers sharing the same name (#1190)
* Support multiple headers sharing the same name * Apply suggestions * Don't normalize HTTP header names * apply visual suggestions Co-authored-by: Jakub Roztocil <jakub@roztocil.co> * bump down multidict to 4.7.0 Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
@@ -10,8 +10,8 @@ from .constants import (
|
||||
SEPARATOR_QUERY_PARAM,
|
||||
)
|
||||
from .dicts import (
|
||||
MultipartRequestDataDict, RequestDataDict, RequestFilesDict,
|
||||
RequestHeadersDict, RequestJSONDataDict,
|
||||
BaseMultiDict, MultipartRequestDataDict, RequestDataDict,
|
||||
RequestFilesDict, RequestHeadersDict, RequestJSONDataDict,
|
||||
RequestQueryParamsDict,
|
||||
)
|
||||
from .exceptions import ParseError
|
||||
@@ -73,11 +73,15 @@ class RequestItems:
|
||||
for arg in request_item_args:
|
||||
processor_func, target_dict = rules[arg.sep]
|
||||
value = processor_func(arg)
|
||||
target_dict[arg.key] = value
|
||||
|
||||
if arg.sep in SEPARATORS_GROUP_MULTIPART:
|
||||
instance.multipart_data[arg.key] = value
|
||||
|
||||
if isinstance(target_dict, BaseMultiDict):
|
||||
target_dict.add(arg.key, value)
|
||||
else:
|
||||
target_dict[arg.key] = value
|
||||
|
||||
return instance
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user