Getting globbing error with nested braces at column 189 during curl PUT to Google Sheets API

I’m working with Google Sheets API v4 and trying to update spreadsheet data using a curl command. However, I keep running into a frustrating issue.

Here’s the curl request I’m attempting to make:

curl -v \
-H 'Authorization: Bearer ya29.GlxSB9-EiDh1Mn2EqhCslHvkaGyOX-P4_yDR4MXOt-WdHYQdFfwUJNMfljAFzZfS-YrrATUU2MAKj3R4BcMyOSw55KjJOC0EekE_qusj8GXIxFF3uaGZxGMdlB0IlQ' \
-X PUT \
https://sheets.googleapis.com/v4/spreadsheets/1mHrPXQILuprO4NdqTgrVKlGazvvzgCFqIphGdsmptD8/values/ProductList\!B2:E6\?valueInputOption\='{'"range": "ProductList!B2:E6","majorDimension": "ROWS","values": [["Product", "Price", "Available", "Delivery Date"]

The error message I get is:

curl: (3) [globbing] nested brace in column 189

I can’t figure out what’s causing this globbing issue with the nested braces. The command seems properly formatted to me but curl keeps throwing this error. Has anyone encountered this before and know how to fix it?

This happens because curl treats braces as special characters for URL globbing. With nested braces in your parameters, curl can’t figure out what to do with them. I’ve hit this same issue working with APIs that need complex JSON in query strings. Just add the -g flag to disable globbing - or use --globoff if you prefer. Both make curl treat braces as regular characters instead of trying to expand them. You could also move that JSON data into the request body with -d instead of stuffing it in the URL. Way cleaner and skips the URL encoding mess entirely.

sounds like your braces are messing things up. try wrapping the whole url in single quotes or use --data-urlencode instead. it handles stuff like {} better, trust me!