PragmaticFlow/NBomber.Http

How to send "form-data" or "x-www-form-urlencoded" in the request body?

Closed this issue · 2 comments

From the examples I could only find JSON body...

Hi @double-reinbows
I suppose you want to send POST request with some JSON payload?
Here is an example:

var step = HttpStep.Create("simple step", async (context) =>
                Http.CreateRequest("POST", "https://yourwebsite/test")
                       .WithBody(new StringContent("{ some JSON }", Encoding.UTF8, "application/json"))

Yup this works, thanks!