NBomber icon indicating copy to clipboard operation
NBomber copied to clipboard

Cannot use BaseAddress of the httpClient with NBomber.Plugins.Http

Open CrazyLlama98 opened this issue 3 years ago • 2 comments
trafficstars

I have a static helper to set Timeout and BaseAddress of http clients and creating the HttpClientFactory. image

If I try to use CreateRequest method from plugin like this, using Relative Uri it fails when running load tests: image

And the resulted error in the console is this: image

Am I using it wrong or it can be improved to support also relative paths there, like the one in HttpClient (used for all exposed methods with strings as url)?

private static Uri? CreateUri(string? uri) =>
            string.IsNullOrEmpty(uri) ? null : new Uri(uri, UriKind.RelativeOrAbsolute);

CrazyLlama98 avatar Jul 27 '22 16:07 CrazyLlama98

Hi @CrazyLlama98 I think this case was not covered initially. Can you try to prepare PR?

AntyaDev avatar Jul 28 '22 10:07 AntyaDev

Sure, I think it needs to be in the NBomber.Http. I will prepare it

CrazyLlama98 avatar Jul 28 '22 15:07 CrazyLlama98