Skip to content

Commit 86afc59

Browse files
nxtnmairaw
andauthored
Fix HttpWebRequest.IfModifiedSince (#3854)
* Fix HttpWebRequest.IfModifiedSince * Apply suggestions from code review Co-Authored-By: Maira Wenzel <[email protected]> Co-authored-by: Maira Wenzel <[email protected]>
1 parent 0fd32ac commit 86afc59

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

xml/System.Net/HttpWebRequest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3266,12 +3266,14 @@ The GetHashCode method returns a hash code of the web request. This value can be
32663266
<ReturnType>System.DateTime</ReturnType>
32673267
</ReturnValue>
32683268
<Docs>
3269-
<summary>Gets or sets the value of the <see langword="If-Modified-Since" /> HTTP header.</summary>
3270-
<value>A <see cref="T:System.DateTime" /> that contains the contents of the <see langword="If-Modified-Since" /> HTTP header. The default value is the current date and time.</value>
3269+
<summary>Gets or sets the value of the <c>If-Modified-Since</c> HTTP header.</summary>
3270+
<value>A <see cref="T:System.DateTime" /> that contains the contents of the <see langword="If-Modified-Since" /> HTTP header.</value>
32713271
<remarks>
32723272
<format type="text/markdown"><![CDATA[
32733273
32743274
## Remarks
3275+
If the `If-Modified-Since` header is `null`, then the return value will be set to <xref:System.DateTime.MinValue?displayProperty=nameWithType>.
3276+
32753277
The <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property is a standard <xref:System.DateTime?displayProperty=nameWithType> object and can contain a <xref:System.DateTimeKind?displayProperty=nameWithType> field of <xref:System.DateTimeKind.Local?displayProperty=nameWithType>, <xref:System.DateTimeKind.Utc?displayProperty=nameWithType>, or <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. Any kind of time can be set when using the <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property. If <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType> is set or retrieved, the <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property is assumed to be <xref:System.DateTimeKind.Local?displayProperty=nameWithType> (local time).
32763278
32773279
The classes in the <xref:System.Net> namespace always write it out the <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property on the wire during transmission in standard form using GMT (Utc) format.
@@ -3283,6 +3285,8 @@ The GetHashCode method returns a hash code of the web request. This value can be
32833285
> [!NOTE]
32843286
> The value for this property is stored in <xref:System.Net.WebHeaderCollection>. If WebHeaderCollection is set, the property value is lost.
32853287
3288+
If the <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property is set and 304 (Not Modified) status code is returned, then a <xref:System.Net.WebException?displayProperty=nameWithType> will be thrown by the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A>, <xref:System.Net.HttpWebRequest.GetResponse%2A>, and <xref:System.Net.HttpWebRequest.EndGetResponse%2A> methods.
3289+
32863290
32873291
32883292
## Examples

0 commit comments

Comments
 (0)