Invalid 'HttpContent' instance provided. It does not have a 'multipart' content-type header with a 'boundary' parameter

前端 未结 2 1510
栀梦
栀梦 2021-01-17 09:34

I\'m writing a web api that have a post method accepting files from uploaded from UI.

public async Task> PostAsync()
    {

                 


        
2条回答
  •  广开言路
    2021-01-17 10:01

    First: Postman have a bug in handling file-based requests.

    You can try adding this to your WebApiConfig.cs it worked for me:

    GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();
    

提交回复
热议问题