Advertisement
Guest User

Untitled

a guest
May 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1.  var baseAddress = new Uri("https://steamcommunity.com");
  2.             var cookieContainer = new CookieContainer();
  3.             using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer })
  4.             using (httpClient = new HttpClient(handler) { BaseAddress = baseAddress })
  5.             {
  6.                 cookieContainer.Add(baseAddress, new Cookie("steamLoginSecure", "123"));
  7.                 HttpResponseMessage response =  await httpClient.GetAsync("/market/pricehistory/?country=DE&currency=3&appid=440&market_hash_name=Specialized%20Killstreak%20Brass%20Beast");
  8.                 if (response.IsSuccessStatusCode)
  9.                 {
  10.                     data = await response.Content.ReadAsStringAsync();
  11.                 }
  12.                 else
  13.                 {
  14.                     throw new Exception(response.ReasonPhrase);
  15.                 }
  16.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement