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

参考: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块。

学习的时间不一定要特定安排
原文地址:https://www.cnblogs.com/zhongzheng123/p/7169321.html