Response status code does not indicate success: 404 (Not Found)

Puneet Chandiok 20 Reputation points
2025-01-03T04:04:52.01+00:00

I get the following error while calling an api in my Blazor application:

User's image

Following is the code where the error is pointing:

User's image

And following is the calling api where request is made:

User's image

What went wrong here? Any suggestions?

Thanks,

Puneet Chandiok

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,724 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,643 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,162 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
358 questions
0 comments No comments
{count} votes

Accepted answer
  1. SurferOnWww 3,696 Reputation points
    2025-01-03T05:55:45.67+00:00

    Please try using an absolute url such like http(s)://<hostname>/api/employees instead of relative url api/employees.

    Please note that if the api is located at a cross domain the server of the api must have CORS functionality.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.