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塊。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM