📜  此资源不支持请求实体的媒体类型“纯文本” - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:06.455000             🧑  作者: Mango

代码示例1
var json = JsonConvert.SerializeObject(body);
var content = new StringContent(json);
content.Headers.ContentType= new MediaTypeHeaderValue("application/json");
return _client.PostAsync(requestUri, content);

https://bartwullems.blogspot.com/2018/12/aspnet-web-apimediatype-exception-on.html
POSTED BY BART WULLEMS