I have some API instructions I am trying to follow
(string) source (string) key (string) params[file] (string) params[gender] (int) params[age]
I get how to make the API calls but where it has a开发者_JAVA技巧n array for params (file, gender and age) how to I put that into a query string?
The call works with something like this:
GET https://api-url.com/api?source=lorem&key=dolor
But how would I append that with the params? params[file]=file_name.gif ??
That doesn't seem to work but I'm open to the fact something else could be wrong - just wanted to check how you pass an array in a query string?
Thanks
Yes it's params[file]=xy
in the query string:
your-url/api?source=lorem&key=dolor¶ms[file]=file_name.gif¶ms[age]=23..
Access in PHP: $yourfile = $_GET['params']['file'];
精彩评论