public function set_body($body) { if ($this->method == 'GET') { throw new \Exception(_t('Trying to add a request body to a GET request.')); } $this->body = $body; }