Advertisement
Armaritto

Untitled

Nov 3rd, 2023
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package com.example.calclab.controller;
  2.  
  3. import org.springframework.web.bind.annotation.*;
  4.  
  5. import java.util.Map;
  6.  
  7. @RequestMapping("/api/messages")
  8. @RestController
  9. public class messageController {
  10. @GetMapping("/hello")
  11. public String hello(){
  12. return "Hello World";
  13. }
  14. @PostMapping("/age")
  15. public String postAge(@RequestBody Map<String, Object> payload) {
  16. payload.get("Age");
  17. return "My age is" + payload;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement