Open vasan-agrostar opened 1 week ago
Also, can we drop the user-agent header? curl will send its own user-agent header, and we should respect that.
I understand the issue, but can you clarify what you mean by "quotes have to be escaped"? I interpret it to mean you want the quotes wrapping the headers, url, etc. to be escaped (\'...\'
instead of '...'
) while creating the string, but I fail to see how that would help prevent cURL from misinterpreting the command, because the output command would still be the same, right?
The fix I see is just to replace the single quotes on creation with double quotes, but that may not be general enough.
I think even \' won't work. BTW, it is the shell that interprets this, not curl. For the shell, anything within single quotes, including \ will be interpreted literally.
We could use double-quotes instead of single quotes, but that would mean lot of escaping. We will have to escape ", $, * at the minimum, because these have special meaning in the shell.
Even though it is not required to URL encode the single quote using %, we can do that and it will work. So replace all ' in the cURL command with %27 (even though the zzAPI request will have the single-quote as is).
Postman seems to do the same.
The node module replaces single quotes with %27
, while the extension removes the zzAPI user-agent while calling constructCurl in the module.
I have a parameter which has a quote in it. (I have to access this particular API: https://developer.freshdesk.com/api/#filter_tickets)
The Run Request runs fine, but when I click on "Show Curl", the quotes appear as is, thus terminating the open quote of the URL.