![]() ![]() ![]() You can't assume they'll just look at the parameters and start changing them in search of data. Remember that while using either of these methods, you have to provide a way for the client to discover each of the resources. Here's how facebook does it: /joe.smith/friends?fields=id,name,picture This way you can ask for a specific portion of a huge data set: .uk/messages?limit=10&offset=20Īnother way to decrease the payload would be to only ask for certain parts of your resources' representation. A request like this would result in fetching 10 resources from the messages collection, from 21st to 30th. This is how pagination can be done in accordance with REST. You can change your API to include additional parameters to limit the scope of data returned by your application.įor instance, you could add limit and offset parameters to fetch just a little part. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |