如題:使用postman時發現傳遞包含list的屬性的對象就會報400錯誤:json
HTTP Status 400 – Bad Request Type Status Report Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).函數
自定義json格式以下:post
{
"abc" : "12341234",
"test" : "2342345",
"url" : "",
"aaa" : "#b709de",
"lstMessage" :
[
{
"name" : "first",
"value" : "惺惺惜惺惺",
"color" : "#FF3333"
},
{
"name" : "proName",
"value" : "柔柔弱弱人",
"color" : "#0044BB"
},
{
"name" : "price",
"value" : "99",
"color" : "#0044BB"
},
{
"name" : "priceTime",
"value" : "2018年08月17日",
"color" : "#000"
},
{
"name" : "remark",
"value" : "若有其它問題,請諮詢電話:400-8888-888",
"color" : "#000"
}
]
}url
出現這個錯誤的緣由除去類型轉換的異常,還有一個很是重要,就是須要對象聲明出:默認的構造函數 ,這個很是重要!!! list中若是仍是一個對象那麼該對象一樣須要聲明出:默認的構造函數,否則一樣報錯!!!至此問題終於解決了!!!spa