POST request to an API. Works in postman but getting 404 not found in Angular 6

Discussão em 'Angular' iniciado por TJ37, Fevereiro 13, 2025.

  1. TJ37

    TJ37 Guest

    I'm trying to connect to an external API using a POST request. This is my code in angular, I have the tokens with me:

    this.http.post('https://app.skuvault.com/api/products/getProducts',
    {
    "TenantToken": this.my_tenant_token,
    "UserToken": this.my_user_token

    }
    )
    .subscribe((res:Response)=>{
    this.Skuprod=res;
    console.log(this.Skuprod)
    })
    }


    In order to get the product details from this api I need to include the Tokens in the body in json format. When I do this in postman it works and I get the details of the products. However I get a 404 not found error when I try to implement this code in angular. Is there something wrong with the syntax?

    Continue reading...

Compartilhe esta Página