/** * @return $this * @throws \Exception */ public function deliverPayLoad() { $this->addHeader('Content-Type: application/json'); if ($this->json) { $this->addBodyFragment($this->json); } else { throw new \Exception("No JSON", 500); } return parent::deliverPayLoad(); }