【发布时间】:2018-07-29 22:14:08
【问题描述】:
我正在向 webapi 方法发布一个对象。对象看起来像这样
public class SendRequest
{
public string APIKey { get; set; }
public string Message { get; set; }
}
我有一个例子,我的信息非常大(27mb)。 在发布时它始终为空。
注意 - 我的 SendRequest 不为空,但我的 Message 属性为空。 在类似的文章之后,我这样配置了我的 web.config
<httpRuntime
targetFramework="4.5.1"
maxRequestLength="2147483647"
requestValidationMode="4.0"
executionTimeout="110" />
和
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
但我还是没有赢。
疯狂的是,它只是一个为空的属性(APIKey 被正确传递)所以它不能被 IIS 阻止它可以吗?
我只是在反序列化方面失败了吗?
【问题讨论】:
-
如果一个属性发送而另一个不发送,您可能无法反序列化
标签: c# json asp.net-web-api asp.net-mvc-5