Reputation: 341
Supposing I have requirements:
How should be endpoints REST API structure?
Upvotes: 1
Views: 303
Reputation: 5770
Always ask yourself:
What are my Resources?
POST /api/registration
POST /api/providerRegistration
GET /api/user?userId={userId}
GET /api/friends
GET /api/friends?userId={userId}
POST /api/product
PUT/PATCH /api/product/{productId}
GET /api/products?status={status}
GET /api/products?userId={userId}
And so on - you get the gist of it. Note that the path (REST Resource) is a noun (product
), not a verb (search
).
Upvotes: 1