getResponseHeader function
Retrieves the value of a specific header in the HTTP response from an H4Event instance.
The getResponseHeader function is used to extract the value of a specified header from the HTTP response of an H4Event object. The H4Event object is expected to have a node property that contains the HTTP request, and the node["value"] property is assumed to represent the incoming HTTP request.
Parameters:
event: AnH4Eventinstance containing the HTTP request.header: The name of the header to retrieve.
Returns:
The value of the specified header, or null if the header is not found or the response is null.
Implementation
String? getResponseHeader(H4Event event, String header) {
return event.node["value"]?.response.headers.value(header);
}