DefaultHttpRequestMatcher Class
Matches requests based on HTTP method, URL with sorted query parameters, and request body.
public sealed class DefaultHttpRequestMatcher : IHttpRequestMatcher- Implements
Constructors
| Name | Description |
|---|---|
| DefaultHttpRequestMatcher(bool) | Initializes a new instance of the DefaultHttpRequestMatcher class. |
DefaultHttpRequestMatcher(bool)
DefaultHttpRequestMatcher.csInitializes a new instance of the DefaultHttpRequestMatcher class.
public DefaultHttpRequestMatcher(bool matchRequestBody = true)Parameters
matchRequestBodybool- When
true(the default), the request body is part of the fingerprint, so two requests to the same URL that carry different payloads do not match each other. Set it tofalsefor endpoints whose body varies between runs (a nonce or a timestamp) and should not affect matching.
Properties
| Name | Description |
|---|---|
| IgnoringRequestBody | Gets an instance that matches on method and URL only, ignoring the request body. |
| Instance | Gets the default instance, which includes the request body in the fingerprint. |
| MatchRequestBody | Gets a value indicating whether the request body is part of the fingerprint. |
IgnoringRequestBody
DefaultHttpRequestMatcher.csGets an instance that matches on method and URL only, ignoring the request body.
public static DefaultHttpRequestMatcher IgnoringRequestBody { get; }Property value
Instance
DefaultHttpRequestMatcher.csGets the default instance, which includes the request body in the fingerprint.
public static DefaultHttpRequestMatcher Instance { get; }Property value
MatchRequestBody
DefaultHttpRequestMatcher.csMethods
| Name | Description |
|---|---|
| ComputeFingerprint(HttpRecordingEntry) | Computes a deterministic fingerprint string for a request. Two requests that should match must produce the same fingerprint. |
ComputeFingerprint(HttpRecordingEntry)
DefaultHttpRequestMatcher.csComputes a deterministic fingerprint string for a request. Two requests that should match must produce the same fingerprint.
public string ComputeFingerprint(HttpRecordingEntry entry)