Skip to main content

Response headers

DrevOps\BehatSteps\Steps\Web\ResponseTrait - Source, Example

Verify HTTP response headers.

  • Assert HTTP header presence and values.

Steps​

@Then the response should contain the header :name

Assert that a response contains a header with specified name

Then the response should contain the header "Connection"
@Then the response should not contain the header :name

Assert that a response does not contain a header with a specified name

Then the response should not contain the header "Connection"
@Then the response header :name should contain :value

Assert that a response contains a header with a specified name and value

Then the response header "Connection" should contain "Keep-Alive"
@Then the response header :name should not contain :value

Assert a response does not contain a header with a specified name and value

Then the response header "Connection" should not contain "Keep-Alive"