GET request with Basic Auth token using Angular 6 getting 404 but works fine on Postman

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

  1. TJ37

    TJ37 Guest

    I'm trying to do a GET request on an external API. The api gave me a username and password which I encoded to get the Basic Token. When I test in on Postman everything works fine but when implementing it Angular 6 I get a 404 error, which is strange since I used the exact same URL in Postman. This is my code:

    this.http.get('https://api.easypost.com/v2/shipments',{
    headers:{
    'Authorization':'Basic '+this.token
    }
    }
    ).subscribe((res:Response)=>{
    console.log(res)
    })


    I don't understance why I'm getting a 404. The URL works fine in Postman. This is my networks tab:

    [​IMG]

    Continue reading...

Compartilhe esta Página