コード例 #1
0
 public void Build(IWorkflowBuilder builder)
 {
     builder.SendHttpRequest(activity => activity
                             .WithUrl(new Uri("https://reqres.in/api/login"))
                             .WithMethod(HttpMethod.Post.Method)
                             .WithContent("{\"email\": \"peter@klaven\"}")
                             .WithReadContent(true)
                             .WithSupportedHttpCodes(new[] { 200, 400 }),
                             activity =>
     {
         activity.When("200").WriteLine("OK!");
         activity.When("400").WriteLine("Missing some fields!");
         activity.When("500").WriteLine("Server is sad :(");
     });
 }