Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path variable vs Query parameter 어떤 경우에 뭘 사용해야 할까? #50

Open
songks0922 opened this issue Nov 2, 2022 · 1 comment
Labels
Spring - Kim Yeonghan 김영한님 스프링 강의 관련 질의응답

Comments

@songks0922
Copy link
Collaborator

항상 헷갈렸던 부분인데 정리해봤으면 좋겠습니다. 일반적으론 어떻게 둘을 구분하여 사용하는지 궁금하네요.

@songks0922 songks0922 added the Spring - Kim Yeonghan 김영한님 스프링 강의 관련 질의응답 label Nov 2, 2022
@rkdtmddnjs97
Copy link
Collaborator

resource에 대한 식별을 할때는 Path Variable을 사용하고
필터링이나 정렬 등 추가적인 정보를 넘길 때는 Query Parmeter를 사용하는게 최선책이라고 합니다.
https://ryan-han.com/post/translated/pathvariable_queryparam/

RESTful API 개발을 할 때에도 특정 자원을 요청할때 Path variable를 사용하는게 원칙이기도 합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spring - Kim Yeonghan 김영한님 스프링 강의 관련 질의응답
Projects
None yet
Development

No branches or pull requests

2 participants