Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Future main() async {
  2. var http2 = new http.Client();
  3. var clientID = "com.wildfire.mobile";
  4. var clientSecret = "myspecialsecret ";
  5. var body = "username=usr&password=pwd&grant_type=password";
  6. var clientCredentials = new Base64Encoder().convert(
  7. "$clientID:$clientSecret".codeUnits);
  8. var response = await
  9. http.post(
  10. "http://localhost:8081/auth/token",
  11. headers: {
  12. "Content-Type": "application/x-www-form-urlencoded",
  13. "Authorization": "Basic $clientCredentials"
  14. },
  15. body: body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement