您的位置:首页 > 产品设计 > UI/UE

curl发送post请求出现:Request method 'post' not supported

2017-03-15 11:35 876 查看
今天做一个测试,利用命令行下curl命令发送post请求,后台是springmvc,我的命令书写出了点差错。

curl -X post --data "lpsust=ZAgAAAAAAAGE9MTAwNTg2NTc0ODAmYj0xJmM9NCZkPTExNDA4JmU9RkM2ODgxODAxMDVGNj
E4OEQzOUM5Nzk1NjY2MkJCRTgxJmg9MTQ4OTU0NDAyMTI5MCZpPTEyMDk2MDAmaj0wJmlsPWNuLq4bz7sOwB
S1X4dKb-QmOA&pkgname=com.hgqn.unbeatablepigman.le
novo" http://10.103.94.96:8080/luckydraw/reserve/notify.json
结果就报了错:
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver.handleHttpRequestMethodNotSupported(210)
 | Request method 'post' not supported

出现这个错,提示很明显Request method 'post' not supported。springmvc收到了这样的请求,但是在做方法类型判断时不支持小写。

通过curl发请求,标准写法是 post,get,delete,put等需要大写,原来springmvc对方法类型大小写很敏感。

正确写法:


改正之后再次做操作就成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: