Closed 7robertodantas closed 2 months ago
When you specify url
in the request, you are telling WireMock to match the path and query exactly. Therefore what you are seeing is the expected behaviour because /test?a=wiremock&b=all&c=test
does not equal /test
If you change url
to urlPath
you should see the behavior you are looking for
Ahh @leeturner, got it! Thanks! It worked by replacing the url
to urlPath
.
Closing the issue now.
Proposal
Hi, I'm trying to stub a GET endpoint that expects a few query parameters.
For some reason, WireMock is not matching the URL, even though I have specified the query parameters.
Initially, I tried using
equalTo
for the query parameters, but since that didn’t work, I tried usingcontains
.However, it is still not matching.
Reproduction steps
I have started a new instance of WireMock.
Then, I created a new stub mapping as shown below
Then, I attempted to hit the stubbed endpoint
It returned the following response.
References
No response