Set the state of the request
string $state State of the request (complete, sending, or new):
Overrides Request::setState
public function setState($state) {
parent::setState($state);
if ($state == self::STATE_TRANSFER && !$this->body && !count($this->postFields) && !count($this->postFiles)) {
$this
->setHeader('Content-Length', 0)
->removeHeader('Transfer-Encoding');
}
return $this;
}