1.ajax默認傳遞數據使用json編碼格式:
header: {
'content-type': 'application/json',
}
傳輸的是json格式的數據,例如{“name”:“張三”,“age”:“18”}
2.x-www-form-urlencoded編碼格式:
header: {
'content-type': 'application/x-www-form-urlencoded',
}
以傳輸鍵值對的形式傳參,例如:name=張三&age=18 或者是直接傳遞數組格式的數據