0

I have a backend in java Spring :

@RequestMapping(value = "/login", method = RequestMethod.POST)
public String getLogin(@RequestBody Credential credential) {
    System.out.println("Hello moto");
    System.out.println(credential.toString());
    return "Allo";
}

I have my front in Angular with which I make my API call:

 login() {
const body = {"email": "string", "password": "string"}
this.http.post('http://localhost:8080/login/', {
  "email": "string",
  "password": "string"
}, {responseType: 'json'}).pipe(map(user => {
  console.log("user : ", user);
}));
console.log("userService")

}

My console.log is displayed fine when I click on the button. I manage to make the calls with PostMan I have the answer.. But I can't get it via Angular, do you have any solutions to offer me?

Thanks

Ryan M
  • 18,333
  • 31
  • 67
  • 74

0 Answers0