GetHeader method

Official Content
This documentation is valid for:

Returns the value of a header converted to the variable type.

Syntax

Value = &DataType.GetHeader(Character-expression)

Where:
Character-expression
   Name of the header 

Value
   Value of the header; any type will be converted.

Scope

Extended Data Types: HttpClient, HttpRequest
Generators: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

Samples

Example 1

&value = &httpclient.GetHeader(“User-Agent”)

If the value of the “User-Agent” header is “GeneXus”, its value is stored in the &value variable.

Example 2

The following image shows the Response and Request headers of this article.

GetHeader Method

See Also

HttpClient Data Type
HttpRequest Data Type

More Details

List of HTTP header fields