HTTP Header Equals Assertion
Important
The Message Content assertion has been superseded by the Smart Assertion as of ReadyAPI 3.9.0. The assertions will continue to be available, but we recommend transitioning to Smart Assertions.
The HTTP Header Equals assertion checks whether the header exists in the request or response and has the value you need.
Important
This assertion works with test steps and virtual APIs that receive HTTP messages.
Availability
This assertion is available in multiple ReadyAPI applications. Depending on the application, it validates the following data:
In... | Checks... | To learn more... |
|---|---|---|
The request or response header. | ||
The response header. | See Security Assertions. | |
The request header. |
Create an assertion
Setting up properties
Specify the header name in the Header field.

Specify the expected header value in the Value edit box.
Select additional options to narrow down the expected value:
Option
Description
Ignore case
Make the search case insensitive.
Regular Expression
Treat the entered value as a regular expression.
To learn more about the syntax of regular expressions, see the Oracle documentation.
Examples
The following assertion checks if the response has the
Content-Typeheader with theapplication/jsonvalue:Header
Value
RegEx
Content-Type
application/jsonNo
The following assertion will pass if the response has the
Content-Typeheader with theapplication/jsonorapplication/xmlvalue:Header
Value
RegEx
Content-Type
application/(json|xml)Yes
The following assertion checks if the format of the
Dateheader complies with the standard:Header
Value
RegEx
Date
[a-zA-Z]{3}, \d{2} [a-zA-Z]{3}, \d{4} \d{2}:\d{2}:\d{2} GMTYes
The following assertion checks if the server sends the
PHPSESSIDcookie and sets a valid lifetime for it in seconds:Header
Value
RegEx
Set-Cookie
PHPSESSID=\w*;.*Max-Age=\d*Yes
Other assertions for status codes and headers
Add more assertions for HTTP status codes and response headers:



