angular service
  public extractUsername(token) {
    const headers = new HttpHeaders();
    headers.set('token', token);
    return this.http.get('http://localhost:8081/extractUsername', {headers});
  }
spring boot method
@GetMapping("/extractUsername")
public String extractUsername(@RequestBody(required=false) TokenRequest tokenRequest)  {
    String username = jwtUtil.extractUsername(tokenRequest.getToken());
    return username;
}
I cannot get token with this angular request
So my question is can i use requestbody method with get request? In postman it work as it should, if it is possible how should angular service look? Im new to angular thanks for response.


 
    