design for not returning everything in `GET /posts`

21 Views Asked by At

I'm making a personal blog with API + SPA.

API should be RESTful and SPA is angular.

For admin's panel posts table or landing page (with api GET /posts), I don't want to include post content, It just increase size of data transfer. also GET /posts response needs id in each item but other APIs don't need them because it is in URL (POST /posts/{{id}}, PUT /posts/{{id}}, GET /posts/{{id}})

What is correct design for it?

0

There are 0 best solutions below