Share via


HttpRequestMessageExtensions.IsIfNoneMatch Method

Definition

Checks if the request is conditional having a If-None-Match HTTP header field with a value that matches the current value. In the case of true this can be used to indicate that a 304 (Not Modified) or a 412 (Precondition Failed) status code should be used.

public static bool IsIfNoneMatch(this System.Net.Http.HttpRequestMessage request, System.Net.Http.Headers.EntityTagHeaderValue current);
static member IsIfNoneMatch : System.Net.Http.HttpRequestMessage * System.Net.Http.Headers.EntityTagHeaderValue -> bool
<Extension()>
Public Function IsIfNoneMatch (request As HttpRequestMessage, current As EntityTagHeaderValue) As Boolean

Parameters

request
System.Net.Http.HttpRequestMessage

The request to match.

current
System.Net.Http.Headers.EntityTagHeaderValue

The current etag for the resource. If there is no current etag (i.e. the resource does not yet exist) then use null.

Returns

System.Boolean

Returns true if one of the If-None-Match values match the current etag; or the If-None-Match value is "*" and current is not null; otherwise false.

Applies to