Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added reset() method to Zend\Http\Client and made resetParameters() a…

…lso clear lastRawRequest and lastRawResponse
  • Loading branch information...
commit ee4f9f6c99aba70d3fd88eecded211f63d4d0f04 1 parent c8d3a0c
@driehle authored
Showing with 20 additions and 4 deletions.
  1. +20 −4 library/Zend/Http/Client.php
View
24 library/Zend/Http/Client.php
@@ -455,10 +455,12 @@ public function resetParameters($clearCookies = false, $clearAuth = true)
{
$uri = $this->getUri();
- $this->streamName = null;
- $this->encType = null;
- $this->request = null;
- $this->response = null;
+ $this->streamName = null;
+ $this->encType = null;
+ $this->request = null;
+ $this->response = null;
+ $this->lastRawRequest = null;
+ $this->lastRawResponse = null;
$this->setUri($uri);
@@ -961,6 +963,20 @@ public function send(Request $request = null)
}
/**
+ * Fully reset the HTTP client (auth, cookies, request, response, etc.)
+ *
+ * @return Client
+ */
+ public function reset()
+ {
+ $this->resetParameters();
+ $this->clearAuth();
+ $this->clearCookies();
+
+ return $this;
+ }
+
+ /**
* Set a file to upload (using a POST request)
*
* Can be used in two ways:
Please sign in to comment.
Something went wrong with that request. Please try again.