Base solution for your next web application
Open Closed

API not giving response properly. #10527


User avatar
0
huntethan89 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 10.2
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core

Hi,

I have created one API on ASP.Net zero and using that API from react native. It is giving response one time but when we call the API again it is returning HTML with error.

Following is the error fetched from logs file:-

WARN 2021-08-17 02:59:19,180 [8 ] e.HttpsPolicy.HttpsRedirectionMiddleware - Failed to determine the https port for redirect. ERROR 2021-08-17 02:59:46,486 [16 ] idateAntiforgeryTokenAuthorizationFilter - The required antiforgery request token was not provided in either form field "__RequestVerificationToken" or header value "X-XSRF-TOKEN". Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery request token was not provided in either form field "__RequestVerificationToken" or header value "X-XSRF-TOKEN". at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Abp.AspNetCore.Mvc.Antiforgery.AbpValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)

Can you please let me know what i am missing?

Thanks


1 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @smartlayer

    Can you please check that https://aspnetboilerplate.com/Pages/Documents/XSRF-CSRF-Protection?searchKey=X-XSRF-TOKEN#other-libraries