code: public function setJsonBody($data)
      {
          $this->addHeader("Content-Type: application/json; charset=utf8");
          $this->setBody(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
          return $this;
      }
docs: Set body with JSON data.
  
  @param mixed $data to be encoded as json.
  
  @return self