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.

Example

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

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

Example

In the example shown in the image you can see the Response and Request headers of this article you are reading.

GetHeader Method

Scope

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

See Also

HttpClient Data Type
HttpRequest Data Type

More Details

List of HTTP header fields