Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use CURL to make a GET request with query parameters

I am making the following curl request from the console to test one of my REST API

curl -X GET "http://localhost/api/v1/user/search.json?search_model[first_name]=abc&auth_token=xyzf"

But it is failing with the following error

curl: (3) [globbing] error: bad range specification after pos 58

I wrapped the endpoint with " because & is used to execute the precious command in console. What else am i missing? Why am i getting this error?

like image 253
usha Avatar asked Oct 01 '13 18:10

usha


1 Answers

steve>curl --help | grep glob
 -g, --globoff       Disable URL sequences and ranges using {} and []

Try adding -g.

like image 155
Steve Howard Avatar answered Oct 26 '22 19:10

Steve Howard