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