mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Page:
Request Matching Tips
Pages
Admin API Reference
Compatibility WireMock.org
Conflict on Microsoft.CodeAnalysis.CSharp
Cors
Could not load file or assembly RestEase
Development Information
Faults
FluentAssertions
Home
KestrelServerOptions
Mapping
MimeKit and MimeKitLite
MyGet preview versions
Pact
Proxying
References
RegexExtended
Request Matcher FormUrlEncodedMatcher
Request Matchers
Request Matching CSharpCode
Request Matching GraphQLMatcher
Request Matching JsonMatcher
Request Matching JsonPartialMatcher
Request Matching JsonPartialWildcardMatcher
Request Matching JsonPathMatcher
Request Matching MimePartMatcher
Request Matching ProtoBuf
Request Matching Tips
Request Matching
Response Templating
Scenarios and States
Settings
Stubbing
Using HTTPS (SSL)
Using WireMock in UnitTests
Using WireMock.Net.Aspire
Using WireMock.Net.Testcontainers
Webhook
What Is WireMock.Net
WireMock as a (Azure) Web App
WireMock as a Windows Service
WireMock as a standalone process
WireMock as dotnet tool
WireMock commandline parameters
WireMock.Org
Xamarin Could not load file or assembly
Clone
2
Request Matching Tips
Stef Heyenrath edited this page 2020-07-04 10:32:40 +02:00
Request is not matched
In case you get a 404 back, but you expect a valid match-response on your request, use the the following tips.
Get the request via the admin interface
Do a GET call to http://{{wm_hostname}}/__admin/requests to get information about the request you just sent.
The example below shows:
- The request is not matched and a
404with "No matching mapping found" is returned - The
PartialMappingGuid,PartialMappingTitleshow information about the best mapping found - The
PartialRequestMatchResultshows some details about all matching element. In this case the PathMatcher returns0.0, so this means that something is wrong with the matching on the Path.
"Response": {
"StatusCode": 404,
"Headers": {
"Content-Type": [
"application/json"
]
},
"BodyAsJson": {
"Status": "No matching mapping found"
},
"DetectedBodyType": 2,
"DetectedBodyTypeFromContentType": 0
},
"PartialMappingGuid": "bb4c0d1d-ef2e-4cd2-966a-850b8f1a2829",
"PartialMappingTitle": "Fetch_User_By_Id_66",
"PartialRequestMatchResult": {
"TotalScore": 2.0,
"TotalNumber": 3,
"IsPerfectMatch": false,
"AverageTotalScore": 0.66666666666666663,
"MatchDetails": [
{
"Name": "PathMatcher",
"Score": 0.0
},
{
"Name": "MethodMatcher",
"Score": 1.0
},
{
"Name": "BodyMatcher",
"Score": 1.0
}
]
}
Get information via the logging
When you run WireMock.Net as standalone console application and logging is enabled, you see the same logging in the console.
Get information via C# code
var server = WireMockServer.Start();
var logEntries = server.LogEntries;
Pages
- Home
- What is WireMock.Net
- WireMock.Org
- References
- Settings
- Admin REST API
- Proxying
- Stubbing
- Webhook
- Request Matching
- Response Templating
- Unit Testing
- Using WireMock
- Advanced
- Errors