I want to do something like following:
curl localhost:8080/myapp/?params={"first_key":"I'm the first value","second_key":"the second value"}
This is working pretty normal when I am trying to access the page via browser, but it does not work via cURL. What am I doing wrong?
The issue is caused by cURL's "URL globbing parser" (see the docs):
So your command is being expanded to:
You need to use the
-g
option (or--globoff
):So:
Then, to preserve the double quotes, you need to wrap the URL in single quotes: