1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular 19 HTTP request to .NET Core 8

Discussão em 'Angular' iniciado por vahid, Novembro 25, 2025.

  1. vahid

    vahid Guest

    I create a .NET Core Angular template project in Visual Studio 2022 which has a controller named "Weather forecast". All HTTP requests to this controller work properly but the similar HTTP request to my new controller doesn't work.

    I even add this line to my proxy.config.js:

    context:[
    "weatherforecast",
    "/test"
    ]


    My controller code:

    [ApiController]
    [Route("[controller]")]
    public class TestController : ControllerBase
    {
    [HttpPost]
    public IActionResult Post()
    {
    return new JsonResult("Hello Test Post");
    }
    }


    My Angular function:

    test() {
    http.post('/test', {}).subscribe(
    (result) => {
    console.log(result);
    }
    );
    }

    Continue reading...

Compartilhe esta Página