Marta
08/20/2024, 11:54 AMvar api = RestClient.For<IWireMockAdminApi>("http://localhost:5050");
var mappingBuilder = api.GetMappingBuilder();
mappingBuilder.Given(m => m
.WithTitle("This is my title 1")
.WithRequest(req => req
.UsingGet()
.WithPath("/my-path")
.WithParams(??) // I am not sure how to add query parameters here
)
.WithResponse(rsp => rsp
.WithStatusCode(200)
.WithBody("response body")
.WithHeaders(h => h.Add("Content-Type", "application/json"))
)
);
mappingBuilder.BuildAndPostAsync();
I see that there is a WithParams() method in the RequestModelBuilder, but I am not sure how to use it to add query parameters to my request. Could anyone provide an example or guide me on how to do this?
Thank you in advance for your help.Lee Turner
08/20/2024, 12:59 PMBas Dijkstra
08/20/2024, 2:11 PM