public function getBodyByType($type) { if (isset($this->bodyList[$type])) { return $this->bodyList[$type]; } elseif (isset($this->bodyList['*/*'])) { return $this->bodyList['*/*']; } throw new \Exception('No body found for type "' . $type . '"'); }