yuta yanagisawa
yuta yanagisawa

Reputation: 71

RESTful URL style guide for searching

If one is allowed to put multiple values on single Query Parameter,

should the parameter name be in singular or plural form?

/user?status=1,2,3

vs

/user?statuses=1,2,3

I tried to google it but no one covers about this specific matter

Upvotes: 4

Views: 713

Answers (1)

Ben Smith
Ben Smith

Reputation: 20230

As your endpoint allows a user to query for a number of statuses, then you would use the plural of status i.e.

/user?statuses=1,2,3

If your endpoint only allows a user to query for a single status you would use the singular i.e.

/user?status=1

Upvotes: 2

Related Questions