码迷,mamicode.com
首页 > Web开发 > 详细

ajax 参数出现在Request payload导致request.getParameter(name)是获取不到值

时间:2017-07-14 13:33:47      阅读:1060      评论:0      收藏:0      [点我收藏+]

标签:plain   ack   form   common   parse   orm   pair   set   ram   

 

参考:http://stackoverflow.com/questions/10494574/what-is-the-difference-between-form-data-and-request-payload

if a request (typically POST) has Content-type header set to application/x-www-form-urlencoded the body is expected to be in the form of a standard querystring with url-encoded key=value pairs joined by &. Form data section then shows the key-value parameters (when viewed parsed). This way was much more common in past because it is a default for HTML forms.

other cases are shown in Request payload section (and nowadays parsed for readability as well for common formats like JSON).

如果请求的Content-Type设置为application/x-www-form-urlencoded,那么这个Post请求被认为是HTTP POST表单请求,参数出现在

其他情况如使用原生AJAX的POST请求如果不指定请求头Request Header,默认使用的Content-Type是text/plain;charset=UTF-8,参数出现在Request payload块。

ajax 参数出现在Request payload导致request.getParameter(name)是获取不到值

标签:plain   ack   form   common   parse   orm   pair   set   ram   

原文地址:http://www.cnblogs.com/zhongzheng123/p/7169321.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!