I have some url which has space in it's query param. I want to use this in curl, e.g.
curl -G "http://localhost:30001/data?zip=47401&utc_begin=2013-8-1 00:00:00&utc_end=2013-8-2 00:00:00&country_code=USA"
which gives out
Malformed Request-Line
As per my understanding o/p is due to the space present in query param.
Is there any away to encode the url automatically before providing it to curl command?
msg = '='
? – Mmmh mmh Oct 15 '15 at 09:14"msg1=Hello&msg2=World"
? This will encode the&
between the parameters which would mean wrong thing to send to the server – Ganesh Satpute Jul 28 '16 at 13:08--data-urlencode
parameters, one for each key-value pair. – Martijn Pieters Aug 09 '16 at 13:04--data-urlencode
option, like in the example provided – Lucas Cimon May 02 '19 at 17:07localhost:123/hello%20world
. – Dan M. Jul 11 '22 at 12:45