contentType
contentType 主要设置你发送给服务器的格式
contentType默认值
ajax方式请求交互
post方式
RequestHeader中设置值
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
contentType: application/json
发送参数’formdata’
get方式
RequestHeader中设置值
contentType: application/json
发送参数’Query String Parameters’
设置contentType:“application/json”,
post方式
这种类型是 text , 我们 ajax 的复杂JSON数据,用 JSON.stringify序列化后,然后发送,在服务器端接到然后用 JSON.parse 进行还原;
参数是Request Payload,发送的为json字符串格式参数:JSON.stringify(param),不能是json对象
get方式
发送参数’Query String Parameters’