Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/Codeception/Module/REST.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function getRunningClient()
}

/**
* Sets a HTTP header to be used for all subsequent requests. Use [`deleteHeader`](#deleteHeader) to unset it.
* Sets a HTTP header to be used for all subsequent requests. Use [`unsetHttpHeader`](#unsetHttpHeader) to unset it.
*
* ```php
* <?php
Expand All @@ -188,7 +188,7 @@ public function haveHttpHeader($name, $value)
}

/**
* Deletes a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)),
* Unsets a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)),
* so that subsequent requests will not send it anymore.
*
* Example:
Expand All @@ -198,18 +198,25 @@ public function haveHttpHeader($name, $value)
* $I->sendGET('test-headers.php');
* // ...
* $I->deleteHeader('X-Requested-With');
* $I->sendPOST('some-other-page.php');
* ?>
* $I->sendPost('some-other-page.php');
* ```
*
* @param string $name the name of the header to delete.
* @param string $name the name of the header to unset.
* @part json
* @part xml
*/
public function deleteHeader($name)
public function deleteHeader(string $name): void
{
$this->connectionModule->deleteHeader($name);
}

/**
* @deprecated Use [unsetHttpHeader](#unsetHttpHeader) instead
*/
public function deleteHeader($name)
{
$this->unsetHttpHeader($name);
}

/**
* Checks over the given HTTP header and (optionally)
Expand Down