首页 > 解决方案 > 在 Rest Api C# 中将大字节数组添加到 Post 请求参数

问题描述

我在常规帖子 Api 中有一个 Post 方法

public async Task<IHttpActionResult> Postt([FromBody]Parameter parameter)
{

}

public class Parameter
{
    public DateTime ValueDate { get; set; }
    public byte[] Blob { get; set; }
}

当 Blob 太大(从二进制文件中读取)时,我可能会收到 null,并且 ModelState 处于无效状态。

任何猜测或替代?

标签: c#restapi

解决方案


推荐阅读