generic response

최대 1 분 소요

generic response

We can say that GenericResponse is a term used to express a general response class. This type of class provides us with a generalized structure to cover the different types of data that the API can return. Thus, we can return various responses to the client, such as success information, error messages, data and other relevant information, through the same format. generic resposne == 공통 응답 이점 == 공통화된 구조를 제공 클라이언트로 응답을 줄 때 모두 동일한 포맷에 대해 응답을 줄 수 있음

advantage

design a consistent structure for responses from different endpoints. Another advantage of this approach is that the client side can process API responses more easily, because the responses will always come with the same format. 각기 다른 endpoins를 가진 API들이 클라이언트 측으로 응답을 줄 때 이렇게 동일하게 주게되면 클라이언트 입장에서는 API 요청에대한 응답값에대해 핸들링할 때 매우 편리하다.