Ejemplo n.º 1
0
 /**
  * @param string $method
  * @param bool   $hasBody
  *
  * @return \Unirest\Response
  */
 protected function send($method = 'get', $hasBody = false)
 {
     if ($this->customBody) {
         $response = $this->request->{$method}($this->url(), $this->headers, $this->customBody);
     } elseif ($hasBody) {
         $response = $this->request->{$method}($this->url(), $this->headers, $this->resource->encode());
     } else {
         $response = $this->request->{$method}($this->url(), $this->headers);
     }
     return $response;
 }
 /**
  * @param \Artesaos\Restinga\Contracts\Data\Resource $resource
  *
  * @return \Artesaos\Restinga\Contracts\Data\Resource
  */
 public function childResource(ResourceContract $resource)
 {
     $resource->setParentResource($this);
     return $resource;
 }