System.Net.HttpWebRequest.IfModifiedSince Property

Gets or sets the value of the If-Modified-Since HTTP header.

Syntax

public DateTime IfModifiedSince { get; set; }

Value

A DateTime that contains the contents of the HTTP If-Modified-Since header. The default value is the current date and time of the system.

Remarks

The HttpWebRequest.IfModifiedSince property is a standard DateTime object and can contain a DateTimeKind field of DateTimeKind.Local, DateTimeKind.Utc, or DateTimeKind.Unspecified. Any kind of time can be set when using the HttpWebRequest.IfModifiedSince property. If DateTimeKind.Unspecified is set or retrieved, the HttpWebRequest.IfModifiedSince property is assumed to be DateTimeKind.Local (local time).

The classes in the System.Net namespace always write it out the HttpWebRequest.IfModifiedSince property on the wire during transmission in standard form using GMT (Utc) format.

If the HttpWebRequest.IfModifiedSince property is set to DateTime.MinValue, then the If-Modified-Since HTTP header is removed from the HttpWebRequest.Headers property and the System.Net.WebHeaderCollection.

If the HttpWebRequest.IfModifiedSince property is DateTime.MinValue, this indicates that the If-Modified-Since HTTP header is not included in the HttpWebRequest.Headers property and the System.Net.WebHeaderCollection.

Note:

The value for this property is stored in System.Net.WebHeaderCollection. If WebHeaderCollection is set, the property value is lost.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0