curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: [brain-storm] Can we make JSON posting easier?

From: Paul Gilmartin via curl-users <>
Date: Thu, 10 Jun 2021 06:41:53 -0600

On 2021-06-10, at 01:48:57, Daniel Stenberg wrote:
> ...
> This makes it a quoting challenge. You can't use single-quotes around the whole thing as then the environment variables won't work etc. Not to mention what happens if the variable itself expands to something that contains a quote...!
> Can we introduce a way to make this easier for future curl users?
> Very basic example:
> curl -d "{string: \"$name\"}" $URL
I have a couple scripts in which I do something akin to:
    curl "$( printf "Paste URL: " >&2; cat )"

... a desperate measure, and it doesn't address the
environment variable requirement.

-- gil

Received on 2021-06-10