Пример #1
0
 /**
  * @param array $config
  * @return RestRequest
  */
 protected function getAuthRequest(array $config)
 {
     if (empty($config['endpoint'])) {
         throw new UserException('Request endpoint must be set for the Login authentication method.');
     }
     if (!empty($config['params'])) {
         $config['params'] = UserFunction::build($config['params'], $this->params);
     }
     if (!empty($config['headers'])) {
         $config['headers'] = UserFunction::build($config['headers'], $this->params);
     }
     return RestRequest::create($config);
 }
Пример #2
0
 /**
  * @expectedException \Keboola\Juicer\Exception\UserException
  * @expectedExceptionMessage Request params must be an array
  */
 public function testValidateConfig()
 {
     $request = RestRequest::create(['endpoint' => 'ep', 'params' => 'string']);
 }
Пример #3
0
 /**
  * @param array $config
  * @return RestRequest
  */
 public function createRequest(array $config)
 {
     return RestRequest::create($this->getRequestConfig($config));
 }