Skip to main content

has_vary_header

Check to see if the response has a given header name in its Vary header.

def has_vary_header(
response: HttpResponse,
header_query: string
) - > boolean

Check to see if the response has a given header name in its Vary header.

Parameters

NameTypeDescription
responseHttpResponseThe HTTP response object containing headers to be inspected
header_querystringThe specific header name to search for within the response's Vary header

Returns

TypeDescription
booleanTrue if the specified header name is present within the comma-delimited Vary header of the response, False otherwise