From 92fe4bfb21eb446b519f08188e5a390c06a0e2b2 Mon Sep 17 00:00:00 2001 From: Kyle Bebak Date: Sat, 17 Apr 2021 13:55:32 -0500 Subject: [PATCH] Add --data-raw arg to curl_to_request; prepare for 2.39.4 --- commands/import_export.py | 5 +++-- messages.json | 2 +- messages/release_notes.txt | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/commands/import_export.py b/commands/import_export.py index 61f0f0a..7c0a528 100644 --- a/commands/import_export.py +++ b/commands/import_export.py @@ -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 @@ -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) @@ -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' diff --git a/messages.json b/messages.json index 09bc403..e01f3b1 100644 --- a/messages.json +++ b/messages.json @@ -1,4 +1,4 @@ { "install": "messages/install.txt", - "2.39.3": "messages/release_notes.txt" + "2.39.4": "messages/release_notes.txt" } diff --git a/messages/release_notes.txt b/messages/release_notes.txt index 949f1d3..20dee5f 100644 --- a/messages/release_notes.txt +++ b/messages/release_notes.txt @@ -1,3 +1,7 @@ +# 2.39.4 +Fixes bug in parsing --data-raw cURL arg. + + # 2.39.3 Changes domain of docs site.