Last active
January 29, 2022 05:04
-
-
Save alexandru-calinoiu/451bb7cdaa1e67111ae7 to your computer and use it in GitHub Desktop.
Send a CURL get request with an array param
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This took me longer that I will like to find out | |
curl "http://localhost:3000/v1/collections/42/items?fields[]=synopsis" -v -H "Content-Type: application/json" -H "X-Session-Token: xxx" --globoff |
Make sure you have url encoded '[' with %5B and ']' with %5D.
Your curl command should look something like this
curl -X GET "httpx://uri?name%5B0%5D=value1&name%5B1%5D=value2"
@valo-ur can u pls look to my this issue: https://stackoverflow.com/questions/69640308/how-to-pass-array-in-php-curl-get-request-laravel
i need an urgent fix. Pls help
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not working for me
i ave to send a get request through curl with array parameter with a name[0]=value1&name[1]=value2 how should i do it can u help