Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public static async Task<string> post()
  2. {
  3. var client = new HttpClient();
  4.  
  5. string postData = "This is a test that posts this string to a Web server.";
  6.  
  7. var response = await client.PostAsync("http://www.contoso.com/PostAccepter.aspx ", new StringContent(postData));
  8. var content = await response.Content.ReadAsStringAsync();
  9. return content.ToString();
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement