curl -G --data-urlencode 'q=react hooks' 'https://api.example.com/search'

Category: Web App Development

curl -G --data-urlencode 'q=react hooks' 'https://api.example.com/search'

Build a GET query string with encoded values

Sends a GET request whose query string is assembled from the --data-urlencode arguments, so spaces become %20 in the URL. The -G flag switches the data flags from POST body to URL parameters. Repeat the flag for multiple parameters.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.