Tengo un problema con el siguiente servicio: El cual cuando invoca al end point construye una url con 3 parámetros el cual al ser invocado renderiza una vista del servidor. Al realizar el subscriber de este servicio en el component, en el network si me arroja la vista pero en consola me arroja "ERROR OK" No se como es la forma correcta de consumir este servicio Ya que quiero que esa url se abra en el navegador
public clientId = 'newClient';
public redirectUri = 'http://localhost:3000';
constructor(private httpClient: HttpClient) { }
getOauth() {
const headers = new HttpHeaders({ 'Content-type': 'application/x-www-form-urlencoded; charset=utf-8' });
const params = new HttpParams({
fromObject:{
client_id: '3',
response_type: 'code',
redirect_uri: this.redirectUri
}
});
//return this.httpClient.post(`${environment.apiUrl}/oauth2/authorize`, params.toString(), { headers: headers });
return this.httpClient.get<any>(`${environment.apiUrl}/oauth2/authorize`, { params: params, headers:headers } )
}
}
MI COMPONENTE QUE CONSUME LO TENGO ASI
uriOauth2 (){
this.oauthService.getOauth().subscribe(val => console.log(val));
}