Ejemplo map verbos en Controller

package com.trifulcas.SpringBootAPI.controller;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CategoryController {

	@GetMapping("/get")
	public String get() {
		return "get";
	}

	@PostMapping("/post")
	public String post() {
		return "post";
	}

	@PutMapping("/put")
	public String put() {
		return "put";
	}

	@PatchMapping("/patch")
	public String patch() {
		return "patch";
	}

	@DeleteMapping("/delete")
	public String delete() {
		return "delete";
	}
}

Publicado por

Juan Pablo Fuentes

Formador de programación y bases de datos