mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Facing issue with WildcardMatcher and '?' #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pradkhanna on GitHub (May 10, 2017).
Originally assigned to: @StefH on GitHub.
Hi
I'm building a mock response for the uri...
/config/api/foundation/economic-regions/search?channel=1&brand=2
though the mock is setup... I'm getting response for all characters except ? in the uri.
like,
/config/api/foundation/economic-regions/searchachannel=1&brand=2
/config/api/foundation/economic-regions/search.channel=1&brand=2
From the code here, I see the Regex Replace(@"?", ".")
How do I build the mock for my uri? Please Help.
@StefH commented on GitHub (May 10, 2017):
I guess you want to match parameters?
Then you can use something like:
which will match an url like :
http://localhost/foo?bar=1&bar=2@pradkhanna commented on GitHub (May 11, 2017):
Thanks StefH.
But, I'm using a .json configured mapping something like this....
so your Create().WithParam("bar", "1", "2"); would be a RequestMessageParamMatcher? and at what level in the above config .json's "Request" would it go?
@StefH commented on GitHub (May 11, 2017):
Maybe a better option would be to use the RegexMatcher to create a regular expression which matches your url
@pradkhanna commented on GitHub (May 20, 2017):
Sorry for the late response. I've got the response mapped using .withParam(); and got my mapping.json file configured using it. Thanks again.
@StefH commented on GitHub (May 20, 2017):
Cool !