Challenge, and Growth ! Who am I
                                                                                                             

Welcome to my blog 🫧

Total

Today

Yesterday













Framework/Spring

[Springboot] @RequestBody @RequestParam @PathVariable 차이점

뽀시라운 2024. 11. 10. 22:59
반응형
SMALL

[목차여기]

 

내가 맨날 헷갈려서 정리해놓는 어노테이션 3대장 😤

 

 

@PathVariable

@GetMapping("/api/user/{nickname}/exists")
public ApiResponse<?> isExists(@PathVariable String nickname){

}

 

사용 예시

https://localhost:8080/api/user/sumin/exists

 

 

@RequestParam

@GetMapping("/api/auth/kakao/login")
public ApiResponse<?> login(@RequestParam(value = "code") String code){

}

 

사용 예시

https://localhost:8080/api/auth/kakao/login?code={code값}

 

 

@RequestBody

@GetMapping("/api")
public ApiResponse<?> isExists(@RequestBody DTO dto){

}

 

사용 예시

반응형
LIST
loading