Given I set header "Header-Name" with value "Some-Value"

This step definition is used to set custom HTTP headers for API requests in your automated tests. It lets you add or change headers such as Content-Type, Authorization, or Accept before sending a request.

Given I set header "([^"]*)" with value "([^"]*)"$

This tells the test to create or update a request header with the given name and value.

 

Example #1: Given I set header "Content-Type" with value "application/json"
Example #2: Given I set header "Authorization" with value "Bearer token123"
Example #3: Given I set header "Accept" with value "application/xml"