daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var client = new HttpClient();
  2. var response = await client.GetAsync(uri);
  3.  
  4. string sample;
  5. IEnumerable<string> values;
  6.  
  7. if (response.Content.Headers.TryGetValues("Sample-Header", out values))
  8. {
  9.    // This never happens!
  10.    sample = values.First();
  11. }
  12.    
  13. var client = new HttpClient();
  14. var response = await client.GetAsync(uri);
  15.  
  16. string sample;
  17. IEnumerable<string> values;
  18.  
  19. if (response.Headers.TryGetValues("Sample-Header", out values))
  20. {
  21.    // This happens!
  22.    sample = values.First();
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top