ExtractHttpHeader Class
Used to extract an HTTP header value from the response and place the value of the header into the WebTestContext.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.TestTools.WebTesting.ExtractionRule
Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractHttpHeader
Namespace: Microsoft.VisualStudio.TestTools.WebTesting.Rules
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
Public Class ExtractHttpHeader _
Inherits ExtractionRule
public class ExtractHttpHeader : ExtractionRule
public ref class ExtractHttpHeader : public ExtractionRule
type ExtractHttpHeader =
class
inherit ExtractionRule
end
public class ExtractHttpHeader extends ExtractionRule
The ExtractHttpHeader type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ExtractHttpHeader | Initializes a new instance of the ExtractHttpHeader class. |
Top
Properties
Name | Description | |
---|---|---|
ContextParameterName | Gets or sets the context name of the extracted property. (Inherited from ExtractionRule.) | |
Header | Gets or sets a value representing the name of the header whose value is to be extracted. | |
Required | Gets or sets a value that indicates whether the request fails if the header does not exist. | |
RuleDescription | Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a description for this rule. (Inherited from ExtractionRule.) | |
RuleName | Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a display name for this rule. (Inherited from ExtractionRule.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Extract | Extracts the value of an HTTP header from the response and places the value and context parameter name into the WebTestContext. (Overrides ExtractionRule.Extract(Object, ExtractionEventArgs).) | |
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
Consider the following HTTP headers:
Content-Length : 2036
Cache-Control : private
Content-Type : text/html; charset=utf-8
If Header is set to Content-Length, this rule will extract 2036 from the headers.
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.Rules Namespace
Other Resources
How to: Create a Custom Extraction Rule for a Web Performance Test