Advertisement
Guest User

Untitled

a guest
Jun 6th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   public getUserData(username: string, password: string) {
  2.  
  3.     const httpOptions = {
  4.       headers: new HttpHeaders({
  5.         'Content-Type':  'application/json',
  6.       })
  7.     };
  8.  
  9.     const user = new UserDTO();
  10.     user.username = username;
  11.     user.password = password;
  12.     this.http.post<UserDTO>('http://localhost:8080/login', user, {observe: 'response', headers: httpOptions.headers}).subscribe(res => {
  13.       console.log(res.headers.get('Authorization'));
  14.     });
  15.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement