web前段異常:
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers
異常描述:客戶端無法處理服務器返回的數據特征(格式)
1.在http請求頭中通過accept字段定義客戶端能夠處理的數據格式,
事實上,下圖演示的請求能夠接收服務器端響應的所有MIME 類型
2.下圖演示的請求並沒有指定accept字段,默認能夠處理html,text響應;此時如果服務器響應為application/json 則前端無法處理並報http 406錯誤
3.解決http 406通常需要了解服務響應的MIME類型,然后再請求頭中添加該屬性