How to Create [Authorize] API...?
What Use [FromBody] in API...& How to Using FromBody Create API ....?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hardik DeshaniPosted Aug 2, 2018, 11:42 PM
Below is sample link for creating WebAPI in MVC
https://atozsourcecode.com/BlogPost/Index/cffb4057-1a07-4f81-bd88-35b7c2c8c295/how-to-create-simple-web-api-step-by-step-and-how-to-call-api-from-browser
I hope above link is help you
Jenith ThakkarPosted Jul 30, 2018, 5:17 AM
If you want to create Role Based Api then use Authorise.
[Authorise(Role="Admin")]
[HttpPost]
public HttpResponseMessage Index([FromBody] IndexViewModel)
{
return Ok();
}
Ruchi SharavatPosted Jul 30, 2018, 5:17 AM
Shweta LodhaPosted Jul 30, 2018, 5:09 AM