fork download
  1. class Client
  2. {
  3. RestClient _client = new RestClient(SettingsContainer.ApiPath.Testers);
  4.  
  5. public Client()
  6. {
  7. _client.CookieContainer = new System.Net.CookieContainer();
  8. }
  9.  
  10. public string Ping()
  11. {
  12. var request = new RestRequest("Ping", Method.GET);
  13.  
  14. var response = _client.Execute(request);
  15. return response.Content;
  16. }
  17.  
  18. public string Authentification(string login, int protocolVersion, string userId, string pushToken)
  19. {
  20. var request = new RestRequest("Authentification/{login}/{protocolVersion}/{userId}/{pushToken}", Method.GET);
  21.  
  22. request.AddUrlSegment("login", login);
  23. request.AddUrlSegment("protocolVersion", protocolVersion.ToString());
  24. request.AddUrlSegment("userId", userId);
  25. request.AddUrlSegment("pushToken", pushToken);
  26.  
  27. var response = _client.Execute(request);
  28.  
  29. foreach (var item in response.Cookies)
  30. {
  31. var cookie = new System.Net.Cookie()
  32. {
  33. Name = item.Name,
  34. Comment = item.Comment,
  35. CommentUri = item.CommentUri,
  36. Discard = item.Discard,
  37. Domain = item.Domain,
  38. Expired = item.Expired,
  39. Expires = item.Expires,
  40. HttpOnly = item.HttpOnly,
  41. Path = item.Path,
  42. Port = item.Port,
  43. Secure = item.Secure,
  44. Value = item.Value,
  45. Version = item.Version
  46. };
  47.  
  48. _client.CookieContainer.Add(cookie);
  49. }
  50.  
  51. return response.Content;
  52. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(51,254): error CS1525: Unexpected symbol `end-of-file'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty