public function setBody(array $body) { if ($this->getMethod() !== 'POST') { throw new Exception\RequestException($this->getMethod() . ' request method must not have body.'); } $this->body = $body; }