DOCS / CSHARPLOAD / HTTP TESTING
HTTP testing
Install CSharpLoad.Http and reuse HttpClient across iterations.
using CSharpLoad.Http;
using var client = new HttpClient { BaseAddress = new Uri("https://localhost:5001") };
var scenario = Scenario.Create("api")
.HttpGet("health", client, "/health")
.Step(HttpStep.Post("create-order", client, "/orders", context => new StringContent("{}")));By default HTTP 2xx is successful. HttpStepOptions can customize status classification and inspect a response in OnResponse. HTTP steps emit status-code, bytes-sent and bytes-received metrics.