I am trying to make a curl get request to my api through command line.
curl http://localhost:8080/getList?id=100&mrp=50&discount=0
But when I log the request in my api I get:
&{GET /getList?id=100 HTTP/1.1 1 1 which means that only id is being sent through the request. I don't understand why it is happening.
When you run the curl command with multiple request parameters separated by &, unix treats the & as sign to execute the previous command in the background.Everthing else following it is treated as a separate command.
Wrap the url in quote while sending the request
curl "http://localhost:8080/getList?id=100&mrp=50&discount=0"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With