2016-07-26 09:43:09 -05:00
|
|
|
package com.baeldung;
|
|
|
|
|
|
2017-10-19 17:51:31 +02:00
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
2016-07-26 09:43:09 -05:00
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
2017-10-19 17:51:31 +02:00
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
2016-07-26 09:43:09 -05:00
|
|
|
@RestController
|
|
|
|
|
public class BaeldungController {
|
2016-08-02 12:34:08 +03:00
|
|
|
|
2017-10-19 17:51:31 +02:00
|
|
|
@GetMapping("/hello")
|
2016-08-02 12:34:08 +03:00
|
|
|
public String sayHello(HttpServletResponse response) {
|
2016-07-26 09:43:09 -05:00
|
|
|
return "hello";
|
|
|
|
|
}
|
2016-08-02 12:34:08 +03:00
|
|
|
|
2017-10-19 17:51:31 +02:00
|
|
|
@PostMapping("/baeldung")
|
2016-08-02 12:34:08 +03:00
|
|
|
public String sayHelloPost(HttpServletResponse response) {
|
2016-07-26 09:43:09 -05:00
|
|
|
return "hello";
|
|
|
|
|
}
|
|
|
|
|
}
|