Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Unable to get Response from API in angular

I have created a Rest API in Java with the request Mapping(/value/generate).

System.out.println(value);
        
        
        if(!value.equals(null)){
         return new ResponseEntity(value, HttpStatus.OK);
        }
        return new ResponseEntity(HttpStatus.FORBIDDEN);
            
    }

Value is getting printed in Console when iam call this through postman.

But i need to print this value in my Angular console.

Below is code i have created in angular.

service.ts

generatevalue(): Observable<String> {
return this.http.get('https://localhost:8080/value/generate')

Component.ts

ngOnInit() {
     this.service.generatevalue().subscribe((Response) => {
      console.log(Response)
     
  }
 }

Please let me know where i went wrong.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your url should probably be "http://localhost:8080/value/generate". Did you check your console for errors? It should print an error 404 somewhere.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda