I have a Web API program that has 8 get methods.
Each method can get 2 parameters - filters
and sorts
.
filters
- a json object that contains all the params you can filter bysorts
- an array that contains all the properties you want to sort by
For example:
www.facebook.com/GetFriends?filters={name:"lior", color:{name:"blue", RGB:{255, 100, 0}}}&sorts=[{prop:"name", desc:true}, {prop:"age", desc:false}]
The api's only available from other servers, so there's no need to worry about URL characters limit in browsers.
We chose GET
method because the purpose of this api is only to get data.
I'm not sure the url we require is in a 'normal' format-
Is that okay in a GET
method to use a two query params that one of them is json and the other is array?
Thank you for your help