REST - getting a specific resource property only in a collection

I am developing the search functionality of my REST API and currently the URI is structured as:

api/items?type=egg,potato

Let's say each element resource has 4 properties:

Identifier, name, type, rating

What would be the calmest way to develop my URI and return a subset of the properties of each resource, for example. only the names of these resources?

-

I ask about this because I often want to get a less severe result. For example, I can create an AJAX search with dynamically populated names in the form of drop-down menus, but I do not want additional bloating to be returned with each request.

+4
source share
1

REST - , .

, , type egg potato. , field. , API api/items?type=egg&fields=name, name egg.

P.S , API, - select. , Facebook API.

+2

All Articles