![](/img/trans.png)
[英]How do I send a request to another domain and get the response body in a Spring MVC controller?
[英]Spring MVC: How to set body parameter in request browser and how to get this body parameters in controller in Spring MVC?
我遵循可能的链接,发现我需要使用@Requestbody
批注,并且需要在@RequestMapping
批注下的标头中设置Content-Type=application/x-www-form-urlencoded
。 但是我没有找到任何示例,例如如何在浏览器中设置这些主体参数并进入控制器
@RequestMapping(value = "/login", headers="application/x-www-form-urlencoded" , method = RequestMethod.GET)
public void login(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServiceException {
// I need username and password body parameters value in controller
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.