From 3846be9fdc0adcc2246e652bd991f1805e24679a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 14 Oct 2020 20:03:03 +0200 Subject: [PATCH] Update REST.php See https://github.com/Codeception/module-rest/issues/22 --- src/Codeception/Module/REST.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index d75b464..a3c7c16 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -201,7 +201,7 @@ protected function getRunningClient(): AbstractBrowser } /** - * 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 * haveHttpHeader('X-Requested-With', 'Codeception'); * $I->sendGet('test-headers.php'); * // ... - * $I->deleteHeader('X-Requested-With'); + * $I->unsetHttpHeader('X-Requested-With'); * $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(string $name): void + public function unsetHttpHeader(string $name): void { $this->connectionModule->deleteHeader($name); } + + /** + * @deprecated Use [unsetHttpHeader](#unsetHttpHeader) instead + */ + public function deleteHeader(string $name): void + { + $this->unsetHttpHeader($name); + } /** * Checks over the given HTTP header and (optionally)