我有一个由
创建的简单模拟HttRequestMessage
public static HttpRequestMessage FromJson(string uriString, string json = null)
{
var request = new HttpRequestMessage()
{
RequestUri = new Uri(uriString)
};
if (json != null)
{
request.Content = new HttpContentJson(json);
}
request.Properties.Add("HttpContext", new DefaultHttpContext() { });
return request;
}
运行req.CreateErrorResponse(…)
时,它会给出无用的异常消息
System.ArgumentNullException:'值不能为null。参数名称: 提供者的
那么provider
是什么?