If I try to pass a URL to curl that contains brackets, it fails with an error:
$ curl \'http://www.google.com/?TEST[]=1\'
curl: (3) [globbing] illegal charac
Globbing uses brackets, hence the need to escape them with a slash \
. Alternatively, the following command-line switch will disable globbing:
--globoff
(or the short-option version: -g
)
Ex:
curl --globoff https://www.google.com?test[]=1
Never mind, I found it in the docs:
-g/--globoff
This option switches off the "URL globbing parser". When you set this option, you can
specify URLs that contain the letters {}[] without having them being interpreted by curl
itself. Note that these letters are not normal legal URL contents but they should be
encoded according to the URI standard.