What are the best practices to design a resource representation?
What are the best practices to design a resource representation?
Designing a resource representation in an API involves several best practices to ensure consistency, usability, and maintainability. Here are some key best practices:
/users
instead of /getUsers
[7][9]./users
for a collection of user resources[1][7]./users/{userId}
for a specific user[7][9]./users/{userId}/orders/{orderId}
to show that orders are nested under users[3][13]./users/{userId}
instead of /users/{user_id}
[1]./v1/users
[14].Accept
...middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào