INNER CODE UNIT · Python
parse_curl
Far-Se/tabame · plugins/api-client/main.py:432
def parse_curl(text):
t = text.lstrip()
t = re.sub(r"\\\s*\n", " ", t) # bash line continuation
t = re.sub(r"\^\s*\r?\n", " ", t) # cmd.exe line continuation
t = t.replace('""', '\\"') # cmd.exe doubled-quote escaping -> posix escape
try:
tokens = shlex.split(t, posix=True)
except ValueError:
tokens = t.split()
url = ""
method = None
headers = {}
data_parts = []
form_fields = {}
used_get_params = False
auth_user = ""
auth_pass = ""