tamkuipap

Untitled

Feb 3rd, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2. using RestSharp;
  3. namespace HelloWorldApplication
  4. {
  5. class HelloWorld
  6. {
  7. static void Main(string[] args)
  8. {
  9. var client = new RestClient("https://id.kiotviet.vn/connect/token");
  10. client.Timeout = -1;
  11. var request = new RestRequest(Method.POST);
  12. request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
  13. request.AddParameter("scopes", "PublicApi.Access");
  14. request.AddParameter("grant_type", "client_credentials");
  15. request.AddParameter("client_id", "7d1dd282-0749-44f0-9044-f0394c4f06eb");
  16. request.AddParameter("client_secret", "B796FE0B53162F33430521B7EE17C1B07D04BD4D");
  17. IRestResponse response = client.Execute(request);
  18. Console.WriteLine(response.Content);
  19. Console.ReadLine();
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment