Skip to content

Commit

Permalink
Add --data-raw arg to curl_to_request; prepare for 2.39.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebebak committed Apr 17, 2021
1 parent f77cd4c commit 92fe4bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions commands/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def request_to_httpie(request):


def curl_to_request(curl):
"""Lifted from: https://github.com/spulec/uncurl, but with many improvements.
"""Lifted from: https://github.com/spulec/uncurl, but with some improvements.
Rewritten to remove `six` and `xerox` dependencies, and add parsing of cookies
passed in `-b` or `--cookies` named argument Also added support for `-A` and
Expand All @@ -328,6 +328,7 @@ def curl_to_request(curl):
parser.add_argument('-H', '--header', action='append', default=[])
parser.add_argument('-A', '--user-agent', default=None)
parser.add_argument('--data-binary', default=None)
parser.add_argument('--data-raw', default=None)
parser.add_argument('--compressed', action='store_true')

tokens = shlex.split(curl, comments=True)
Expand All @@ -338,7 +339,7 @@ def curl_to_request(curl):
method = parsed_args.request

base_indent = ' ' * 4
post_data = parsed_args.data or parsed_args.data_binary or ''
post_data = parsed_args.data or parsed_args.data_binary or parsed_args.data_raw or ''
if post_data:
if not parsed_args.request:
method = 'post'
Expand Down
2 changes: 1 addition & 1 deletion messages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"install": "messages/install.txt",
"2.39.3": "messages/release_notes.txt"
"2.39.4": "messages/release_notes.txt"
}
4 changes: 4 additions & 0 deletions messages/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.39.4
Fixes bug in parsing --data-raw cURL arg.


# 2.39.3
Changes domain of docs site.

Expand Down

0 comments on commit 92fe4bf

Please sign in to comment.