我试图发送一个file
从一postman
到web api
,方法上的web api
期待类型的列表包含的文档类型,文件和文件夹的名字..下面贴:
Web API方法:
[HttpPost("post-images")]
public async Task<IList<RepositoryItem>> PostAnImages (IList<PostRepoRequest> request)
{
// rest of the code
}
PostRepoRequest类:
public class PostRepoRequest
{
public FileType FileType { get; set; }
public IFormFile File { get; set; }
public string Folder { get; set; }
}
可能会发现我从未收到过一个文件,它始终为null,我也尝试将标头content-type设置为,multipart/form-data
但是效果也不好。
这可能是什么把戏?
谢谢
干杯
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句