0

Let's say I have an endpoint for getting customers: /customers with different modes in the request query. For example: /customers?mode={type}, where type could be one of [employee, owner].

Let's say, I have different logic for getting either employee or owner(for example, for owners I return only firstName and lastName and for employees, I'm adding their passportId(no matter what actually). Plus, there is a different set of permissions needed for accessing employee or owner.

The question is next: what's the logic limit for dividing GET request(for example /persons/employees, /persons/owners. Should I even do this?

  • I think https://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request describes a limit. – Reporter Feb 12 '18 at 15:55
  • @reporter Thanks! But I'm not talking about URL length. It is all about the internal logic of request handler and response. Let's say we have `read employees` and `read customers` permissions. So, in case someone has `read employees` but not `read customers` and want to GET employees we should check his permissions to give him what he wants. Let's say that in future we will add additional logic into getting each mode(`employee` and `owner`) and each of request handlers would be pretty big. Is it enough for adding `/persons/employees`? – sydlostarot Feb 12 '18 at 16:32

0 Answers0