NBomber plugin for defining HTTP scenarios
To install NBomber.Http via NuGet, run this command in NuGet package manager console:
PM> Install-Package NBomber.Http
Documentation is located here
Would you like to help make NBomber even better? We keep a list of issues that are approachable for newcomers under the good-first-issue label.
class Program
{
static void Main(string[] args)
{
var step = HttpStep.Create("simple step", (context) =>
Http.CreateRequest("GET", "https://gitter.im")
.WithHeader("Accept", "text/html")
.WithHeader("Cookie", "cookie1=value1; cookie2=value2")
//.WithBody(new StringContent("{ some JSON }", Encoding.UTF8, "application/json"))
//.WithCheck(response => Task.FromResult(response.IsSuccessStatusCode))
);
var scenario = ScenarioBuilder.CreateScenario("test gitter", new[] {step})
.WithConcurrentCopies(100)
.WithDuration(TimeSpan.FromSeconds(10));
NBomberRunner.RegisterScenarios(scenario)
.RunInConsole();
}
}