Пример #1
0
 /**
  * Method returns the response for the requested resource
  * @param  string $pURI 
  * @param  array  $pOptions
  * @return mixed
  */
 protected function requestResource($pURL, array $pOptions)
 {
     $options = array_replace_recursive($this->settings['defaults'], $pOptions);
     $format = $options['format'];
     $method = $options['method'];
     $this->setHeaders($options);
     $parameters['headers'] = $this->headers;
     if (isset($options['body'])) {
         $parameters['body'] = $this->setBody($options);
     }
     $request = $this->client->createRequest($method, $pURL, $parameters);
     try {
         $response = $this->client->send($request);
     } catch (RequestException $e) {
         $this->assignExceptions($e);
     }
     return $this->responseFormat($response, $format);
 }
Пример #2
0
 public function __construct(ClientInterface $client, EventInterface $event, InputInterface $input, RedirectInterface $redirect, StorageInterface $storage, $settings)
 {
     parent::__construct($client, $event, $input, $redirect, $storage, $settings);
 }
Пример #3
0
 public function __construct(ClientInterface $client, EventInterface $event, InputInterface $input, RedirectInterface $redirect, StorageInterface $storage, $settings)
 {
     parent::__construct($client, $event, $input, $redirect, $storage, $settings);
     $this->parameters = $this->settings['parameters'];
 }