WebTestResponse Class
Represents an HTTP response.
Inheritance Hierarchy
Object
Microsoft.VisualStudio.TestTools.WebTesting.WebTestResponse
Namespace: Microsoft.VisualStudio.TestTools.WebTesting
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
<SerializableAttribute> _
Public Class WebTestResponse _
Implements ICloneable
[SerializableAttribute]
public class WebTestResponse : ICloneable
[SerializableAttribute]
public ref class WebTestResponse : ICloneable
[<SerializableAttribute>]
type WebTestResponse =
class
interface ICloneable
end
public class WebTestResponse implements ICloneable
The WebTestResponse type exposes the following members.
Properties
Name | Description | |
---|---|---|
BodyBytes | Gets the raw bytes of the HTTP response body. | |
BodyString | Gets a string version of the response body for responses with text, HTML, or XML content types. | |
CharacterSet | Gets the character set that is specified in the response headers. | |
ContentEncoding | Gets the method that is used to encode the body of the response. | |
ContentLength | Gets the length of the content that is returned by the request. | |
ContentType | Gets the MIME type of the response body. | |
Cookies | Gets the cookies associated with the response. | |
Guid | ||
Headers | Gets the headers associated with the response from the server. | |
HtmlDocument | Gets the HtmlDocument created by parsing the response body of a response with HTML or XHTML content type. | |
IsBodyEmpty | Gets a value indicating whether the response body is empty. | |
IsHtml | Gets a value indicating whether the response body is an HTML document. | |
IsText | Gets a value indicating whether the response body is a text document. | |
IsXml | Gets a value that indicates whether the response is XML. | |
LastModified | Gets the last date and time that the contents of the response were modified. | |
Method | Gets the method that is used to return the response. | |
ProtocolVersion | Gets the version of the HTTP protocol that is used in the response. | |
ResponseUri | Gets the URI of the Internet resource that responded to the request. | |
Server | Gets the name of the server that sent the response. | |
Statistics | Gets detailed information gathered during the execution of the request. | |
StatusCode | Gets the status of the response. | |
StatusDescription | Gets the status description returned with the response. | |
XmlDocument | Gets a XmlDocument representing the response body if the content type indicated the response was XML. |
Top
Methods
Name | Description | |
---|---|---|
Clone | Clones the test response body. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
This encapsulates an HTTP response that is provided by a HttpWebResponse. Many HTTP features are exposed through the WebTestResponse properties.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.VisualStudio.TestTools.WebTesting Namespace