Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.calclab.controller;
- import org.springframework.web.bind.annotation.*;
- import java.util.Map;
- @RequestMapping("/api/messages")
- @RestController
- public class messageController {
- @GetMapping("/hello")
- public String hello(){
- return "Hello World";
- }
- @PostMapping("/age")
- public String postAge(@RequestBody Map<String, Object> payload) {
- payload.get("Age");
- return "My age is" + payload;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement