Created
June 4, 2014 05:52
-
-
Save lmatt-bit/6f46b20f0d0cf2cd843a to your computer and use it in GitHub Desktop.
httpclient post with ntlm auth
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
| HttpClientHandler handler = new HttpClientHandler(); | |
| handler.UseDefaultCredentials = true; | |
| using(var client = new HttpClient(handler)) { | |
| var content = new FormUrlEncodedContent(new[] { | |
| new KeyValuePair<string, string>("query", "test"), | |
| new KeyValuePair<string, string>("position", "top") | |
| }); | |
| var result = client.PostAsync("http://url/", content).Result; | |
| Console.WriteLine(result.Content.ReadAsStringAsync().Result); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment