V
V
Vermut7562017-01-13 00:48:31
API
Vermut756, 2017-01-13 00:48:31

What is it called when the JSON REST API accepts a list of ids and returns it, but notes which are in the server database and which are not?

What is it called when the JSON REST API accepts a list of ids and returns it, but notes which are in the server database and which are not?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2017-01-13
@al_gon

It's called that this is not a REST API
You have Id'sfrom some entities. Imagine that from collection1
To play your script and stay in REST. You need to send a GET request with Id.
The entities that will return are in the DB, otherwise absent. If you only need Id's, then add a parameter fieldsand a value to the requests id. And this is already beginning to move away from the "classical", and becomes the object of controversy and philosophical conclusions.
Examples:
1)

{host}/{restapi}/collection1?id="id1"&id="id2"&id="id3"

2)
{host}/{restapi}/collection1?id="id1"&id="id2"&id="id3"&fields=id

3)
{host}/{restapi}/collection1?id=["id1","id2","id3"]&fields=id

Example 1) correct, 2) good, example 3) bad

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question