PragmaticFlow/NBomber.Http

POST call and status code for NBomber.Http

Closed this issue · 3 comments

Can I make post call using this extension? I have found that it supports only get call, do you have any plane to give support for other HTTP verbs?

How I can assert the response from the HTTP call? Is there any to get the HTTP status code from response?

Hi @hasibul2363

Can I make post call using this extension?

Yes, you can.

HttpStep.CreateRequest("POST", "https://www.youtube.com")
              .WithBody(new StringContent("{ some json }"))
              .BuildStep("POST request");

How I can assert the response from the HTTP call?

Currently, you can't, this extension is checking status code only.
But if you need to understand if your response is good or bad then you should use plain NBomber
https://github.com/PragmaticFlow/NBomber/blob/dev/examples/CSharp/CSharp.Examples/Scenarios/Http.cs#L28

Then you will be able to analyze your response content.

We will add usch feature in the next release of NBomber.Http

Hi @hasibul2363 is it solved your issue? Can I close it?