Multiple query string parameters via curl

I’m trying to get a simple first project up and running, but I’m can’t seem to pass multiple arguments on my query string to the agent when I curl the endpoint, e.g. https://agent.electricimp.com/foo?led=1&ledIndex=0

My request.query only contains the first argument.

This works from the browser or via a tool like hurl.it, but not the command line.

I’ve done this loads of times before, and it should work fine. Can you show us your curl statement?

It’s literally just curl https://agent.electricimp.com/insertmyuseridhere?led=1&ledIndex=0 (with my actual user id of course)

It’s bizarre that it works fine from a browser’s location bar or from www.hurl.it

I’m assuming it has something to do with GET vs POST. I’ll try it again tonight from an iOS app I’m building to communicate with the Imp.

You may need quotes around your URL

curl “https://agent.electricimp.com/insertmyuseridhere?led=1&ledIndex=0

Ah, of course – sorry, I’m an idiot. The ampersand in the query string is backgrounding the job. Thanks for your help.

No problem - it’s a common mistake with command line curl :slight_smile: