简体   繁体   中英

How to return count in Rest API

I'd like to return a count of some articles, how should the URL looks like? Does it make sense to be /api/articles/count ? I do not have a resource to return articles and do not need to do that, I am interested only in the count.

Does it make sense to be /api/articles/count?

Sure it makes sense.

Just to mention the URI structure does not matter that much if your api meets the HATEOAS constraint of REST.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM