Why is curl truncating this query string?

The answer to the question, "what am I doing wrong," is that the shell sees the ampersand (&) and thinks that's the end of the command (and puts it into the background). You need to quote it, which is why the answers that quoted the string work. You could just as easily run this:

curl -v -L "http://localhost:5000/pulse?lat=41.225&lon=-73.1"

I think you can try this:

 curl -v -L -d "lat=41.225&lon=-73.1" http://localhost:5000/pulse

by default, this calls POST. If you want to send a GET request

 curl -v -L -G -d "lat=41.225&lon=-73.1" http://localhost:5000/pulse

More...
and since you're using localhost, if you were to use https, you'd probably want to include -k as an option to ignore certificate errors

Thanks to Ross for pointing this.

Tags:

Curl

Urlencode