curl --data-urlencode 'q=hello world' http://localhost:3000/search

Category: Web App Development

curl --data-urlencode 'q=hello world' http://localhost:3000/search

Send form data with URL encoding

Posts a q field containing hello world, with curl percent-encoding the space automatically. The --data-urlencode flag saves you from hand-escaping query values. Use -G instead of -X POST to send encoded fields as a query string.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.