Guest User

Untitled

a guest
Oct 23rd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. POST /oauth/token HTTP/1.1
  2. Host: localhost:8080
  3. Authorization: Basic YXBwbGljYXRpb246c2VjcmV0
  4. Content-Type: application/x-www-form-urlencoded
  5. Cache-Control: no-cache
  6. Postman-Token: 9f9582e9-fe73-499f-d7f7-82498a974e39
  7.  
  8. grant_type=password&username=pedroetb&password=password
  9.  
  10. let headers = new Headers();
  11. headers.append('Content-Type', 'application/x-www-form-urlencoded');
  12. headers.append("Authorization","Basic YXBwbGljYXRpb246c2VjcmV0");
  13.  
  14. var obtainTokenUrl = 'http://localhost:8080/oauth/token';
  15.  
  16. this._http.post(obtainTokenUrl + "?grant_type=password&username=pedroetb&password=password", null, {headers: headers}).subscribe(response => {
  17. console.log(response);
  18. });
Add Comment
Please, Sign In to add comment