Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions httpie/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ def make_request_kwargs(
headers = make_default_headers(args)
if base_headers:
headers.update(base_headers)
# Preserve existing Content-Type when merging user-supplied headers
user_content_type = headers.get('Content-Type')
headers.update(args.headers)
if user_content_type and 'Content-Type' not in args.headers:
headers['Content-Type'] = user_content_type
if args.offline and args.chunked and 'Transfer-Encoding' not in headers:
# When online, we let requests set the header instead to be able more
# easily verify chunking is taking place.
Expand Down
Loading