示例#1
0
 public function decode($body)
 {
     $data = parent::decode($body);
     $this->method = $data['method'];
     $this->id = $data['id'];
     return $data['params'];
 }
示例#2
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;
 }