- 아래 사이트를 참조함
https://www.leafcats.com/173
- 같은 패키지에 RestTestController 클래스 만들어줌
- 아래 코드 삽입
@RestController
public class RestTestController {
@RequestMapping("/restTest")
public String restTest(@RequestParam String str){
return str + " : test 완료";
}
}
- 브라우저에 http://localhost:8080/restTest?str=test"를 입력하여 테스트 확인
이것도 해당 블로그 내용이 전부인데 혹시나 없어질까봐 기록...
'프레임워크 > Spring' 카테고리의 다른 글
[Spring] HTTP request 보내기 (RestTemplate) (0) | 2022.01.06 |
---|---|
[Spring] CrudRepository findById가 안될 때 (0) | 2022.01.04 |
[Spring] IntelliJ에서 import에 빨간 불일 때 (0) | 2022.01.04 |
HTTP Header는 case-sensitive인가 (0) | 2021.12.03 |
Spring Hello world 출력 (0) | 2021.07.09 |