2
在asp.net mvc 5中對HttpClient使用PutAsJsonAsync擴展方法返回自檢參考循環檢測到的異常。使用HttpClient PutAsJsonAsync Extension檢測到的自回參考循環
這裏是調用代碼:
httpClient.BaseAddress = _uri;
HttpResponseMessage response = await httpClient.PutAsJsonAsync<b>("index/1",b);
response.EnsureSuccessStatusCode();
對象B不會具有自參考。
所以我的問題是如何在一個asp.net mvc 5應用程序中設置SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore
。