Share via


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
Public property BodyBytes Gets the raw bytes of the HTTP response body.
Public property BodyString Gets a string version of the response body for responses with text, HTML, or XML content types.
Public property CharacterSet Gets the character set that is specified in the response headers.
Public property ContentEncoding Gets the method that is used to encode the body of the response.
Public property ContentLength Gets the length of the content that is returned by the request.
Public property ContentType Gets the MIME type of the response body.
Public property Cookies Gets the cookies associated with the response.
Public property Guid
Public property Headers Gets the headers associated with the response from the server.
Public property HtmlDocument Gets the HtmlDocument created by parsing the response body of a response with HTML or XHTML content type.
Public property IsBodyEmpty Gets a value indicating whether the response body is empty.
Public property IsHtml Gets a value indicating whether the response body is an HTML document.
Public property IsText Gets a value indicating whether the response body is a text document.
Public property IsXml Gets a value that indicates whether the response is XML.
Public property LastModified Gets the last date and time that the contents of the response were modified.
Public property Method Gets the method that is used to return the response.
Public property ProtocolVersion Gets the version of the HTTP protocol that is used in the response.
Public property ResponseUri Gets the URI of the Internet resource that responded to the request.
Public property Server Gets the name of the server that sent the response.
Public property Statistics Gets detailed information gathered during the execution of the request.
Public property StatusCode Gets the status of the response.
Public property StatusDescription Gets the status description returned with the response.
Public property XmlDocument Gets a XmlDocument representing the response body if the content type indicated the response was XML.

Top

Methods

  Name Description
Public method Clone Clones the test response body.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method 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

Other Resources

Working with Web Tests

HTTP