Created
January 28, 2013 22:39
-
-
Save darrelmiller/4659969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CookieContainer cookieJar = new CookieContainer(); | |
HttpClientHandler handler = new HttpClientHandler | |
{ | |
CookieContainer = cookieJar, | |
AllowAutoRedirect = true | |
}; | |
handler.UseCookies = true; | |
handler.UseDefaultCredentials = false; | |
HttpClient client = new HttpClient(handler as HttpMessageHandler); | |
//cookieJar.Add(new Cookie("clientfoo", "bar2", "/", "OAK")); | |
cookieJar.Add(new Uri("http://oak:9999/"), new Cookie("clientfoo", "bar2")); | |
var response = client.GetAsync(new Uri("http://oak:9999/api/Cookie")).Result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment