Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

call AntiForgeryToken api

$
0
0

hi i have created no authentication asp.net core mvc app, i added api controller,  tested using postman working fine then i enabled AntiForgeryToken after this i can't consume the api from postman . how to consume api with AntiForgeryToken?

using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using System.Linq;

namespace MvcStudent.Controllers
{
    [Route("api/[controller]")]
    public class TestController : Controller
    {


        public TestController()
        {

        }


         [HttpPost]
         [ValidateAntiForgeryToken]
        public string OCR(byte[] DocBytes)
        {
            return "working";
        }


    }
}


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>