GetHeader Function


The GetHeader function sets either all the HTTP headers or a single HTTP header (specified in the HttpHeaderName optional parameter) in a 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.


HTTP GET HOST Hostname URL url szVar = GetHeader(options);
HTTP GET HOST Hostname URL url szVar = GetHeader(options, HeaderName);
HTTP GET HOST Hostname URL url szVar = GetHeader(options, HeaderName, Index);
szVar = GetHeader(HttpHeaders, HeaderName);
szVar = GetHeader(HttpHeaders, HeaderName, Index);



A string variable into which the headers will be loaded.


Available options are:

CONTENT  The function is applied on the current HTTP response 


A string expression containing the name of the HTTP header to be retrieved.


A string expression containing a set of HTTP headers from which the function will extract a specified header.


An integer expression which specifies the index of the HeaderName HTTP header name to be retrieved.


STRING szContentTypeHeader;
STRING szServerHeader;
STRING szAllHeader;

HTTP GET HOST "" URL "/fmstocks/home.asp" szContentTypeHeader = GetHeader(content, "Content-Type");
HTTP GET HOST "" URL "/fmstocks/home.asp" szAllHeader = GetHeader(content);
szServerHeader = GetHeader(szAllHeader, "Server");

// Retrieve second Set-Cookie HTTP header
HTTP GET HOST "" URL "/fmstocks/home.asp" szSetCookieHeader = GetHeader(content, "Set-Cookie", 2);

See also:

Go back to the Learning center:

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