Model Binding for multipart/form-data (File + JSON) post in ASP.NET Core 1.1

后端 未结 2 1958
旧时难觅i
旧时难觅i 2021-01-12 07:08

I\'m attempting to build an ASP.NET Core 1.1 Controller method to handle an HTTP Request that looks like the following:

POST https://localhost/api/data/uploa         


        
2条回答
  •  长情又很酷
    2021-01-12 07:37

    I'm not 100% clear on how this would work for ASP.NET Core but for Web API (so I assume a similar path exists here) you'd want to go down the road of a Media Formatter. Here's an example (fairly similar to your question) Github Sample with blog post

    Custom formatters might be the ticket? https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/custom-formatters

提交回复
热议问题