Y
Y
yakov_l2020-02-11 13:56:38
JavaScript
yakov_l, 2020-02-11 13:56:38

How with api to accept only those objects that have a certain property?

axios.defaults.headers.common['x-api-key'] = process.env.VUE_APP_ANIMALS
let response = await axios.get('https://api.thedogapi.com/v1/images/search', {params: {limit:50 , size: "full"}})


How to accept only 20 objects that have the breeds property?
Now I accept 50 and filter, which is not very beautiful.
By the way, how to write the above code via fetch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor P., 2020-02-20
@Jeer

Hello, the client accepts what the server gives. Therefore, either filtering takes place on the client, or there must be one more parameter on the server, and it is the server that must give the correct result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question