GetHeader Function


Description:

The GetHeader function sets either all the HTTP headers or a single HTTP header (specified in the HttpHeaderName optional parameter) in a character string variable. This function can be either integrated into HTTP/S requests or executed independently.

If the function is not attached to a HTTP request, the first parameter is the input character string on which the function is applied.

Format:

In a HTTP request:

        HTTP GET HOST Hostname URL url &
        ,SET httpHeaderVar = GetHeader()

        HTTP GET HOST Hostname URL url &
        ,SET httpHeaderVar =
GetHeader(httpHeaderName)

Independently:

        httpHeaderVar = GetHeader(inputHttpHeaders , httpHeaderName )

Parameters:

httpHeaderVar

The name of a character variable into which the HTTP headers will be loaded.

httpHeaderName

A character variable, quoted character string or character expression containing the name of the HTTP header to be retrieved.

inputHttpHeaders  (only if not attached to a HTTP request)

A character variable, quoted character string or character expression containing the input data to which the function is applied.

 

Example:

In an HTTP request:

STRING CONTENT_TYPE_HEADER
STRING ALL_HEADERS

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp",IDENTIFIER 10 &
    ,Set CONTENT_TYPE_HEADER = GetHeader("Content-type") &
    ,Set ALL_HEADERS = GetHeader()

Independently:

STRING CONTENT_TYPE_HEADER
STRING ALL_HEADERS

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp",IDENTIFIER 10 &
    ,Set ALL_HEADERS = GetHeader()

CONTENT_TYPE_HEADER=GetHeader(ALL_HEADERS, "Content-type")

See also:

 

 

 





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap