Skip to content

New HttpRequestException.StatusCode property #4042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions xml/System.Net.Http/HttpRequestException.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,92 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpRequestException (string message);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.Http.HttpRequestException.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; HttpRequestException(System::String ^ message);" />
<MemberSignature Language="F#" Value="new System.Net.Http.HttpRequestException : string -&gt; System.Net.Http.HttpRequestException" Usage="new System.Net.Http.HttpRequestException message" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Http</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
</Parameters>
<Docs>
<param name="message">A message that describes the current exception.</param>
<summary>Initializes a new instance of the <see cref="T:System.Net.Http.HttpRequestException" /> class with a specific message that describes the current exception.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpRequestException (string message, Exception inner, HttpStatusCode? statusCode);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner, valuetype System.Nullable<valuetype System.Net.HttpStatusCode> statusCode) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.Http.HttpRequestException.#ctor(System.String,System.Exception,System.Nullable{System.Net.HttpStatusCode})" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String, inner As Exception, statusCode As Nullable(Of System.Net.HttpStatusCode)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; HttpRequestException(System::String ^ message, Exception ^ inner, Nullable<System::Net::HttpStatusCode> statusCode);" />
<MemberSignature Language="F#" Value="new System.Net.Http.HttpRequestException : string * Exception * Nullable<System.Net.HttpStatusCode> -&gt; System.Net.Http.HttpRequestException" Usage="new System.Net.Http.HttpRequestException (message, inner, statusCode)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Http</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="inner" Type="System.Exception" />
</Parameters>
<Docs>
<param name="message">A message that describes the current exception.</param>
<param name="inner">The inner exception.</param>
<param name="statusCode">The HTTP status code.</param>
<summary>Initializes a new instance of the <see cref="HttpRequestException" /> class with a specific message that describes the current exception, an inner exception, and an HTTP status code.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="StatusCode">
<MemberSignature Language="C#" Value="public System.Net.HttpStatusCode? StatusCode { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable<valuetype System.Net.HttpStatusCode> StatusCode" />
<MemberSignature Language="DocId" Value="P:System.Nullable{System.Net.HttpStatusCode}" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property StatusCode As Nullable(Of System.Net.HttpStatusCode)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Nullable<System::Net::HttpStatusCode> ^ StatusCode { Nullable<System::Net::HttpStatusCode> ^ get(); };" />
<MemberSignature Language="F#" Value="member this.StatusCode : Nullable<System.Net.HttpStatusCode>" Usage="System.Net.Http.HttpRequestException.StatusCode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Http</AssemblyName>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren is there a way to specify that this property is new in .NET Core 5.0?
The fact it is also part of System.Net.Http is IMO not interesting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I missed this. I left a suggestion about adding a note in the Remarks. Does that work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Applies to section would also indicate the versions the property exists.

</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Nullable{System.Net.HttpStatusCode}</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the HTTP status code to be returned with the exception.</summary>
<value>An HTTP status code if the exception represents a non-successful result, otherwise <c>null</c>.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>