Clear all GET and POST parameters
Should be used to reset the request parameters if the client is used for several concurrent requests.
clearAll parameter controls if we clean just parameters or also headers
bool $clearAll Should all data be cleared?:
public function resetParameters($clearAll = false) {
// Reset parameter data
$this->paramsGet = array();
$this->rawPostData = null;
$this->method = 'GET';
if ($clearAll) {
$this->headers = array();
}
else {
// Clear outdated headers
if (isset($this->headers['content-type'])) {
unset($this->headers['content-type']);
}
if (isset($this->headers['content-length'])) {
unset($this->headers['content-length']);
}
}
return $this;
}