`
angel243fly
  • 浏览: 10572 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

HTTP PUT请求时,表单数据无法传递

阅读更多
Put请求一般可用来修改服务器中的资源,但如果你需要提交给服务器一些表单数据,那么遗憾的告诉你,PUT请求不支持,最简单的方法就是改用POST请求,我也是今天在项目中才知道的,特此记下,共同学习。
具体请看:
SRV.4.1.1 When Parameters Are Available

The following are the conditions that must be met before post form
data will be populated to the parameter set:

1. The request is an HTTP or HTTPS request.
2. The HTTP method is POST.
3. The content type is application/x-www-form-urlencoded.
4. The servlet has made an initial call of any of the getParameter
family of methods on the request object.

大概意思是:
以下条件是在post form数据在被移至参数集合之前必须满足的条件:

   1. request是HTTP/HTTPS request
   2. HTTP method是POST。
   3. content type是application/x-www-form-urlencoded。
   4. servlet已经对request对象中所有getParameter可以得到的参数做了初始化调用。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics