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

.NET 8.0 and Angular 19 [closed]

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

  1. vahid

    vahid Guest

    I create a dot 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"
    ]


    I will be appreciated if someone can help me.

    my controller code:

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


    my angular function

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

    Continue reading...

Compartilhe esta Página