public void AddPostKeyRawGetPostBufferTest() { var client = new HttpClient(); client.ContentType = "application/x-www-form-urlencoded"; // raw POST buffer client.AddPostKey("name=Rick&company=West%20Wind"); string post = client.GetPostBuffer(); Console.WriteLine(post); Assert.IsTrue(post == "name=Rick&company=West%20Wind"); }
public void AddPostKeyGetPostBufferTest() { var client = new HttpClient(); client.ContentType = "application/x-www-form-urlencoded"; client.AddPostKey("ctl00_Content_Username", "Rick"); client.AddPostKey("ctl00_Content_Password", "seekrit"); string post = client.GetPostBuffer(); Console.WriteLine(post); Assert.IsTrue(post.Contains("&ctl00_Content_Password=")); }