From 34b7fd2a6232825f5bc88e96c68da3aea585d2a9 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Tue, 18 Feb 2020 12:23:31 -0700 Subject: [PATCH 1/2] Document {BasicHtml,}WebResponseObject properties The properties of WebResponseObject and BasicHtmlWebResponseObject had xmldoc comments which were not particularly informative. Add more informative comments to help users better understand the values returned by these properties. Signed-off-by: Kevin Locke --- .../BasicHtmlWebResponseObject.Common.cs | 18 ++++++++++++------ .../Common/WebResponseObject.Common.cs | 15 +++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs index 664c3d69d46..f407d9266f2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs @@ -57,22 +57,28 @@ public BasicHtmlWebResponseObject(HttpResponseMessage response, Stream contentSt #region Properties /// - /// Gets the Content property. + /// Gets the text body content of this response. /// + /// + /// Content of the response body, decoded using , + /// if the Content-Type response header is a recognized text + /// type. Otherwise null. + /// public new string Content { get; private set; } /// - /// Gets the Encoding that was used to decode the Content. + /// Gets the encoding of the text body content of this response. /// /// - /// The Encoding used to decode the Content; otherwise, a null reference if the content is not text. + /// Encoding of the response body from the Content-Type header, + /// or null if the encoding could not be determined. /// public Encoding Encoding { get; private set; } private WebCmdletElementCollection _inputFields; /// - /// Gets the Fields property. + /// Gets the HTML input elements parsed from . /// public WebCmdletElementCollection InputFields { @@ -99,7 +105,7 @@ public WebCmdletElementCollection InputFields private WebCmdletElementCollection _links; /// - /// Gets the Links property. + /// Gets the HTML a elements parsed from . /// public WebCmdletElementCollection Links { @@ -126,7 +132,7 @@ public WebCmdletElementCollection Links private WebCmdletElementCollection _images; /// - /// Gets the Images property. + /// Gets the HTML img elements parsed from . /// public WebCmdletElementCollection Images { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs index 39ac6bdf20e..f7dcb764e48 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs @@ -18,13 +18,13 @@ public partial class WebResponseObject #region Properties /// - /// Gets or protected sets the Content property. + /// Gets or protected sets the response body content. /// [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public byte[] Content { get; protected set; } /// - /// Gets the StatusCode property. + /// Gets the response status code. /// public int StatusCode { @@ -32,7 +32,7 @@ public int StatusCode } /// - /// Gets the StatusDescription property. + /// Gets the response status description. /// public string StatusDescription { @@ -41,7 +41,7 @@ public string StatusDescription private MemoryStream _rawContentStream; /// - /// Gets the RawContentStream property. + /// Gets the response body content as a . /// public MemoryStream RawContentStream { @@ -49,7 +49,7 @@ public MemoryStream RawContentStream } /// - /// Gets the RawContentLength property. + /// Gets the length (in bytes) of . /// public long RawContentLength { @@ -57,8 +57,11 @@ public long RawContentLength } /// - /// Gets or protected sets the RawContent property. + /// Gets or protected sets the full response content. /// + /// + /// Full response content, including the HTTP status line, headers, and body. + /// public string RawContent { get; protected set; } #endregion Properties From e3be6235fccfd78a5903ad88fd4ab4c6b5954b6e Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Wed, 19 Feb 2020 09:30:39 +0000 Subject: [PATCH 2/2] Apply suggestions from @iSazonov Co-Authored-By: Ilya --- .../WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs index f407d9266f2..54950f84119 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs @@ -78,7 +78,7 @@ public BasicHtmlWebResponseObject(HttpResponseMessage response, Stream contentSt private WebCmdletElementCollection _inputFields; /// - /// Gets the HTML input elements parsed from . + /// Gets the HTML input field elements parsed from . /// public WebCmdletElementCollection InputFields { @@ -105,7 +105,7 @@ public WebCmdletElementCollection InputFields private WebCmdletElementCollection _links; /// - /// Gets the HTML a elements parsed from . + /// Gets the HTML a link elements parsed from . /// public WebCmdletElementCollection Links {