feat: import cURL on paste (#2037)
* feat: import cURL on paste * feat: import cURL on paste * feat: pasting cURL command on url field does not paste it in Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
@@ -69,6 +69,11 @@ const parseCurlCommand = (curlCommand: string) => {
|
||||
curlCommand = curlCommand.replace(/\\/gi, "")
|
||||
curlCommand = curlCommand.replace(/\n/g, "")
|
||||
}
|
||||
// replace string for insomnia
|
||||
curlCommand = curlCommand.replace(/--request /, "-X ")
|
||||
curlCommand = curlCommand.replace(/--header /, "-H ")
|
||||
curlCommand = curlCommand.replace(/--url /, " ")
|
||||
|
||||
// yargs parses -XPOST as separate arguments. just prescreen for it.
|
||||
curlCommand = curlCommand.replace(/ -XPOST/, " -X POST")
|
||||
curlCommand = curlCommand.replace(/ -XGET/, " -X GET")
|
||||
|
||||
Reference in New Issue
Block a user