Guest User

Untitled

a guest
May 27th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. var response = new HttpClient().PostAsync("http://localhost/myservice",
  6. new StringContent("{ "type": "confirmation" }", Encoding.UTF8, "application/json"))
  7. .Result;
  8. Console.WriteLine(response.StatusCode);
  9. }
  10. }
  11.  
  12. var client = new RestClient("http://localhost/myservice");
  13. var request = new RestRequest("api") { Method = Method.POST };
  14. request.AddJsonBody(new { type = "confirmation" });
  15.  
  16. var response = client.Execute(request);
Add Comment
Please, Sign In to add comment