From ceef5659cc9460e1f9b1ea99ca418b91b04c510f Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Mon, 10 Jul 2017 18:48:20 -0700 Subject: [PATCH] I think you need to wrap the json data with a quote --- setup.py | 2 +- uncurl/api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9b94ada..d2068ae 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='uncurl', - version='0.0.8', + version='0.0.8.1', description='A library to convert curl requests to python-requests.', author='Steve Pulec', author_email='spulec@gmail', diff --git a/uncurl/api.py b/uncurl/api.py index 20e2854..8fed228 100644 --- a/uncurl/api.py +++ b/uncurl/api.py @@ -31,7 +31,7 @@ def parse(curl_command): # If we found JSON and it is a dict, pull it apart. Otherwise, just leave as a string if post_data_json and isinstance(post_data_json, dict): - post_data = dict_to_pretty_string(post_data_json) + post_data = '"""\n{}{}\n"""'.format(base_indent, dict_to_pretty_string(post_data_json)) else: post_data = "'{}'".format(post_data)