Exemple #1
0
 /**
  * @return mixed
  */
 public function getBody()
 {
     $result = null;
     if (!empty($this->headers['Content-Type'])) {
         switch ($this->headers['Content-Type']) {
             case 'application/json':
                 $result = JsonTransformer::decode($this->body);
                 break;
             default:
                 $result = $this->body;
         }
     }
     return $result;
 }
 public function encode($body)
 {
     $body = array('jsonrpc' => '2.0', 'result' => $body, 'id' => $this->id);
     return parent::encode($body);
 }