使用PutMapping DeleteMapping PostMapping都报错:Request method 'GET' not supported
@RestController
@RequestMapping("/rabbit")
public class RabbitTest {
@Autowired
private HelloSender1 helloSender1;
@PostMapping("/hello")
public void hello() {
helloSender1.send();
}
结果通过地址栏访问hello方法报不支持Get访问,原来地址栏输入链接默认都是Get方式,将@PostMapping改为@RequestMapping就可以了