I am building API restful server using dotnet core framework. I added my controller and trying to reach an endpoint using postman.
I have 2 problems
Problem 1
// POST api/user [HttpPost] [Authorize()] public async Task<IActionResult> Post([FromBody]UserModel user) { }
Unless I send the request from postman as application/json
by typing raw json, I can't reach this endpoint if I use application/x-www-form-urlencoded
instead I always get 415 unsupported media type
Problem 2
// POST api/user/avatar [HttpPost] [Authorize()] [Route("avatar")] public async Task<IActionResult> Post([FromBody]UserModel user, [FromBody]IFormFile file) { }
I don't know how to reach such an endpoint using postman