|
|
@@ -3,6 +3,7 @@
|
|
|
namespace Opentalent\OtCore\Service;
|
|
|
|
|
|
use GuzzleHttp\Client;
|
|
|
+use GuzzleHttp\Cookie\CookieJar;
|
|
|
use GuzzleHttp\Exception\GuzzleException;
|
|
|
use Opentalent\OtCore\Exception\ApiRequestException;
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
@@ -129,16 +130,17 @@ class OpentalentApiService implements LoggerAwareInterface
|
|
|
*
|
|
|
* @param string $uri
|
|
|
* @param array $params
|
|
|
+ * @param array $options
|
|
|
* @return ResponseInterface
|
|
|
* @throws ApiRequestException
|
|
|
*/
|
|
|
public function get(
|
|
|
string $uri,
|
|
|
array $params = [],
|
|
|
- array $config = []
|
|
|
+ array $options = []
|
|
|
): ResponseInterface
|
|
|
{
|
|
|
- return $this->request('GET', $uri, $params, $config);
|
|
|
+ return $this->request('GET', $uri, $params, $options);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -148,7 +150,7 @@ class OpentalentApiService implements LoggerAwareInterface
|
|
|
* @param string $httpMethod
|
|
|
* @param string $uri
|
|
|
* @param array $params
|
|
|
- * @param array $config
|
|
|
+ * @param array $options
|
|
|
* @return ResponseInterface
|
|
|
* @throws ApiRequestException
|
|
|
*/
|
|
|
@@ -156,7 +158,7 @@ class OpentalentApiService implements LoggerAwareInterface
|
|
|
string $httpMethod,
|
|
|
string $uri,
|
|
|
array $params = [],
|
|
|
- array $config = []
|
|
|
+ array $options = []
|
|
|
): ?ResponseInterface
|
|
|
{
|
|
|
$parsedUrl = parse_url($uri);
|
|
|
@@ -172,7 +174,7 @@ class OpentalentApiService implements LoggerAwareInterface
|
|
|
if ($this->context->isDevelopment()) {
|
|
|
$this->logger->info('API Call: ' . $uri);
|
|
|
}
|
|
|
- return $this->client->request($httpMethod, $uri, $config);
|
|
|
+ return $this->client->request($httpMethod, $uri, $options);
|
|
|
} catch (GuzzleException $e) {
|
|
|
throw ApiRequestException::from_exception($e);
|
|
|
}
|