S
S
spirt_etilovy2017-07-31 18:06:27
API
spirt_etilovy, 2017-07-31 18:06:27

Search in REST API?

Suppose there is a service that stores information about cars, parts from which cars are made, etc. (conditionally, for example).
API resources:
/cars/ - list of cars;
/cars/{0}/ - information about a specific car;
/cars/{0}/details/ - list of car parts;
/cars/{0}/details/{0}/ - information about a specific car detail.
The service should be able to search for cars by the characteristics of parts.
For now, I'm thinking of implementing it like this: /cars/?detail_name=x.
Details can also have child resources, while car search should work with them too (/cars/?detail_name=x&detail_child_resource=y)
How to implement this correctly to comply with REST?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question