在Postman中使用x-www-form-urlencoded,並且用K-V傳值,但是在代碼中用ajax來請求,傳值一直有問題,靜下心來思考才發現K-V傳入的是string,所以記錄下來以防忘記!!!
在Ajax中需要將Value中的json轉換為string:
let robotAuditStr = {"orderId":"","auditor":"","status":0, "type":2,"note":"test"}; $.ajax({ url: `http://cloud.qiyi.domain/apis/audit/robotAudit`, type: "POST", contentType: "application/x-www-form-urlencoded", data: {robotAuditStr: JSON.stringify(robotAuditStr)} })