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

2021-06-22 18:05

阅读:407

标签: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


评论


亲,登录后才可以留言!