415 Unsupported Media Type asp.net core

后端 未结 3 480
余生分开走
余生分开走 2021-01-17 10:47

Detail

I am trying to post a file from Postman to the endpoint I have created. but it gives me this error. I am not passing the header Content-Type in postman

相关标签:
3条回答
  • 2021-01-17 11:22

    In Postman, when creating a POST request, the default is "Text". Change it to JSON.

    0 讨论(0)
  • 2021-01-17 11:29

    In Postman, after ensuring that you're using raw and its in JSON format. Most especially when making GET request and you're not sending any data in the body of the request ensure that the body of the request is not empty. It must have an empty object: { }

    0 讨论(0)
  • 2021-01-17 11:43

    Try using [FromForm] instead of [FromBody] for the method parameter if you're POSTing form data.

    0 讨论(0)
提交回复
热议问题