Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!