Home > Back-end >  The Request method 'POST' not supported sending a POST Request
The Request method 'POST' not supported sending a POST Request

Time:10-16

//template for sending information to the WeChat, public, send a post Request, also receive data successful WeChat end, but the background will be submitted to a Request method 'post' not supported
Written in the framework wxjava and success can send template
But will quote Request method 'POST' not supported abnormal
If use is in accordance with the framework, springboot, but restTemplate get request is no problem, just POST error
@ GetMapping ("/sendMessage ")
Public String sendMessage (ModelMap mmap)
{

ResponseEntity ApiResponse=restTemplate. PostForEntity
(
Url,
O,
String. The class
);


return "";
}

CodePudding user response:

@ GetMapping this definition is dead, you can only get request

CodePudding user response:

To PostMapping

CodePudding user response:

It's no use in the post

CodePudding user response:

Set the request way, with @ RequestMapping or @ POSTMapping

CodePudding user response:

The
reference 3 floor fanqieo response:
, it's no use in the post


Try with the following statement

@ Controller
@ RequestMapping (path="/user")
Public class UserController {

@ RequestMapping (path="/sendMessage", method=RequestMethod. POST)
Public String sendMessage (ModelMap mmap)
}
  • Related